Don't have much expertise in programming. Only picked up Python last summer.
I have installed both Atom and Conda on my computer. Recently, I've used Atom to edit my scripts in Python, then run the scripts via Command Line. As per standard practice, I created Virtual Environments where I installed packages I needed to run different Python scripts.
I now want to use Atom as an IDE, and so have installed the Script package on Atom so I can run my scripts in Atom itself. However, when I tried running a Python script that required the Python numpy package, I got this:
ImportError: No module named 'numpy'
This error is obviously going to appear for other packages that haven't already been installed in the root environment (I think?).
So now, my question is how do I activate the needed Virtual Environment in Atom? In other applications like Jupyter and Spyder, I would activate the Virtual Environment I needed then open the Application via Command Line, but I can't do that with Atom.
(If possible, is there a way to use Virtual Environments created by Conda)
Thanks
Now in the Atom software, at the bottom left of the screen, press noVirtualenv. A window opens where your Virtualenv name is displayed, and you can select it by tapping on it. Now your Virtualenv is ready and you can create or import your own project and get started. Save this answer.
One way is to start atom
from the activated virtual environment. In this case, executing programs/scripts uses the configured python interpreter and imports the installed in the virtual environment.
EDIT: It's been long though, it might be useful for people redirected to this question.
By installing atom-python-virtualenv
you can create, change or deactivate virtual environments with atom editor.
The hydrogen package for Atom works well for this.
You will also need to install Jupyter into your conda environment and Hydrogen should pick up the IPython kernel automatically.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With