Python Spyder IDE and Virtualenv

How do you use another virtual env in Python Spyder IDE?

  1. Activate the environment (e.g. myenv) you like to use
conda activate myenv
  1. Install the spyder-kernels package
conda install spyder-kernels=0.*
pip install spyder-kernels==0.*
  1. Run the following command inside the same environment
python -c "import sys; print(sys.executable)"
  1. Copy the path returned by that command to the textbox at Spyder > Preferences > Python Interpreter > Use the following interpreter
  2. Start a new IPython console and it should be using your myenv

Reference:

Avatar
Luke Sy
PhD Candidate

My research interests include state estimation, robotics, wearable sensors, machine learning, and biomedical engineering.

Next
Previous