Activating a Python virtual environment in Atom

You do not have much experience in programming. Just picked up Python last summer.

I installed Atom and Conda on my computer. I recently used Atom to edit my scripts in Python, and then ran the scripts through the Command Line. In accordance with standard practice, I created a virtual environment where I installed the packages that I need to run different Python scripts.

Now I want to use Atom as an IDE, and so I installed the Script package on Atom so that I can run my scripts in Atom itself. However, when I tried to run Python Script, which required the Python numpy package, I got the following:

ImportError: No module named 'numpy'

This error will obviously be displayed for other packages that have not yet been installed in the root environment (I think?).

So now my question is: how do I activate the required virtual environment in Atom? In other applications, such as Jupyter and Spyder, I would activate the virtual environment that I needed, then open the application through the command line, but I can not do this with Atom.

(If possible, is there a way to use the virtual environments created by Conda)

thanks

+6
source share
2 answers

Atom's hydrogen package works well for this.

You will also need to install Jupyter in your conda environment, and hydrogen should automatically pick up the IPython core.

+1
source

- . script python , .

0

Source: https://habr.com/ru/post/1014268/


All Articles