-
Notifications
You must be signed in to change notification settings - Fork 5.3k
In virtual environment wrong version of python is used #7583
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
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 |
Hi @eudaiman are you still experiencing this issue? Have you been able to take a look at the suggestions above? |
Hi @eudaiman, I hope the suggestions above were helpful and that you were able to resolve your issue! Since this doesn’t appear to be an error within the Notebook codebase, I’ll go ahead and close this. However, please feel free to open a new issue if you run into any other problems that should be addressed in this repository. |
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: