-
Notifications
You must be signed in to change notification settings - Fork 5.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In virtual environment wrong version of python is used #7583
Comments
This suggests to me that perhaps there may be a different kernelspec installed somewhere unexpected. can you share Here's what I get following your steps:
and after launching
so everything appears to be going as expected. |
The issue arises because the --prefix=$VIRTUAL_ENV flag for ipykernel install is incorrect. It installs the kernel in the wrong location, not properly linking it to the virtual environment's Python. create your venv and then activate it, and while in venv you need to install jupyter and ipykernel using pip
and then install kernel properly
Hope this helps |
Description
In my virtual environment I installed jupyter notebook. But when I tried running it, I discovered that it's using the wrong python.
Reproduce
Create venv. Then install venv jupyter:
python -m pip install jupyter
python -m ipykernel install --name=my-kernel-name --prefix=$VIRTUAL_ENV
Then in jupyter notebook import sys and print sys.version. I warrant you it will not be the one in venv.
Expected behavior
Should be the same version as python -V in terminal.
Context
Using Ubuntu 20.04, everything else is latest version (python, jupyter etc.)
The text was updated successfully, but these errors were encountered: