JustAGuy
JustAGuy

Reputation: 129

Make Atom recognize Anaconda env

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?

Upvotes: 1

Views: 1267

Answers (1)

Akin Wilson
Akin Wilson

Reputation: 11

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.)

Upvotes: 1

Related Questions