Issue
which pip3:
/Library/Frameworks/Python.framework/Versions/3.8/bin/pip3
python version in notebook:
import platform
print(platform.python_version())
3.9.2
I want my jupyter notebook to run on python 3.8.
NOTE: I'm intentionally avoiding conda for this exercise.
Solution
Jupyter is installed into a particular Python environment like any other Python module. If Jupyter is running under Python 3.9, then you're running the version of it that was installed by the pip
in Python 3.9. It might be installed in the base 3.9 implementation, or it could be installed in a virtual environment that is based on Python 3.9.
If you want a Jupyter that is running under Python 3.8, then you need to run the version of it that is installed under Python 3.8 or a virtual environment based on 3.8. If no such version exists, then you need to install it using Python 3.8 pip. Once installed, you need to run that version of it. You can always do that by specifying the full path to the appropriate jupyter
binary. But that is, of course, not ideal...
Which version you get when you run just jupyter
is a function of your PATH and/or any Python package manager you might be running. I use pyenv
, and that tool will set it up so that for the Python version I've chosen to be the current global version, that version's (or virtual environment's) bin
directory becomes the first Python bin
directory in my PATH. So if I type jupyter
, I always run the version that is installed in what pyenv
has made the current global Python environment.
Answered By - CryptoFool
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.