Why is Spyder using libraries from base environment instead of virtual environment
See original GitHub issueI created and activated a virtual environment with virtualenv:
virtualenv venv
source venv/bin/activate
Then I installed spyder kernels and other libraries in the virtual environment:
pip install spyder-kernels==0.*
pip install numba==0.50
Then I launched Spyder in the virtual environment:
spyder
And I changed the python interpreter in Spyder to the correct path using: > Python > Preferences > Python interpreter > Use the following Python interpreter
My Python interpreter in my virtual environment is
/Users/myname/venv/bin/python
However, when I import libraries in Spyder, rather than the libraries installed in the virtual environment, Spyder uses the libraries from the base Anaconda environment.
import numba
print(numba.__version__)
0.38.0
print(numba.__file__)
/anaconda3/lib/python3.6/site-packages/numba/__init__.py
This is causing all kinds of errors in my code. What can I do to force Spyder to only use libraries installed in my virtual environment?
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Why is Spyder using libraries from base environment instead ...
However, when I import libraries in Spyder, rather than the libraries installed in the virtual environment, Spyder uses the libraries from ...
Read more >Frequently Asked Questions — Spyder 5 documentation
Q: How do I run Spyder installed in a conda environment using Anaconda Navigator?
Read more >Working with packages and environments in Spyder - GitHub
The most common problem: Using newly-installed packages inside Spyder ... This happens because foo was installed (with either conda or pip ) in...
Read more >5 Steps : Setup Python Virtual environment in Spyder IDE
5 Steps : Setup Python Virtual environment in Spyder IDE · 1. Installing virtualenv package with pip · 2. Creating Virtual Environment for...
Read more >Easy Way to switch Environments in Spyder? - Google Groups
Install Spyder in an environment created by pip and activated using source command rather than command. The reason being when you switch conda...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I upgraded Anaconda Navigator to the most recent version, which came with Spyder 4.0.1 and Python 3.7.6. That alone solved the problem for me. Thank you.
That’s very old. Please update at least to 3.3.6 and try again.