1

I have recently switched to Atom as my IDE and I have been using Anaconda for some time (apparently wrong). I had just used a short script to open atom from a shell with my anaconda env activated (like this: conda activate dev; C:\Users\User\AppData\Local\atom\atom.exe), which did it for me.

However, this creates an unwanted shell and takes an unusual amount of time, so I want to know if there is a way to let Atom know in which env it should be.
For example, putting this

process.env.PATH = ['C:/Users/User/anaconda/bin/', process.env.PATH].join(':')

in init.coffe. But how should Atom know which env to use? Can I replicate conda activate in Atom?

Edit 1:

So I have Atom working with an Anaconda env right now (I had the path configured wrong), but right now it seems to be using packages from base, while I want Atom to use packages and python from dev. Is this possible without completely defeating the purpose of Anaconda envs by putting every environment in the PATH?

JustAGuy
  • 129
  • 1
  • 11
  • Confused about what you mean when you say "Should Atom know which env to use?" Is it using the wrong env currently? could you clarify, please? – griffin_cosgrove Jan 13 '20 at 18:24
  • @griffin_cosgrove Well, when starting Atom via the icon, it recognizes python and most packages, as it seems, but I am not sure from which environment, and the plugin 'Hydrogen Launcher' for example gives an error stating `Could not find 'jupyter' or 'ipython'` when trying to launch a jupyter console. – JustAGuy Jan 13 '20 at 18:57
  • Do you have more than one version of python installed? – griffin_cosgrove Jan 13 '20 at 19:24
  • @griffin_cosgrove I dont, but when searching my files it looks like AutoCad and some others bring their own – JustAGuy Jan 13 '20 at 19:38
  • @griffin_cosgrove Alright I just solved it for me. I had cygwin installed _and_ my Anaconda path had 'python.exe' appended. Should I even have something with Anaconda in the system path? And I'm still not sure from which env Atom is getting these things – JustAGuy Jan 13 '20 at 22:00
  • If I understand your question correctly the answer is yes, Anaconda should be in the system path if you plan to use commands like ```conda foocommand``` With respect to the other comment, what you are looking for is python.exe, if you have more than one version of that installed it could create problems. – griffin_cosgrove Jan 14 '20 at 15:36
  • @griffin_cosgrove I did have several `python.exe`s, but that only made Atom recognize packages from base. Can I switch that to `dev` for example without putting everything in PATH as explained in my edit? – JustAGuy Jan 14 '20 at 21:29
  • I do not use Atom so I am not sure if this is possible, but in VS Code another text editor, the executable of python is set globally for the editor. Maybe you have the wrong python executable in settings of Atom? – griffin_cosgrove Jan 15 '20 at 17:33

1 Answers1

1

I managed to get some where with this.

I was not able to start Atom via launching it whilst in a conda virtual env or virtualenv which was quite frustrating.

But if you are using the __platform-io IDE terminal__, you can very easily configure the Terminal to start in a conda virtual env.

If you head over to the packages tab once you have it installed, then:-

 1) Core settings  - > **Shell Override**:  enter *C:\Windows\System32\cmd.exe*
 2) **Auto Run Commands** -> enter command to activate conda venv e.g. *conda activate activate nlp_tf*

This will then automatically start your Conda virtual environment (in this example _nlp_tf_) with each terminal load.

Hopes this helps

(Now I am trying to figure out how to integrate Hydrogen into this- if anyone knows, please don't hesitate.)

Hamed Baziyad
  • 1,954
  • 5
  • 27
  • 40
  • 1
    Thats definitely helpful, but as you say, having hydrogen use the environment as well would be the real goal for me :) – JustAGuy Jul 02 '20 at 06:43