How to change the kernel of my Jupyter Notebook from using Python3.8.7 to Python3.9.1? Jupyter Notebook run outside Anaconda on MacOS BigSur 11.1, Jupyter Notebook was though pip. Python version just recently upgraded to 3.9.1. Thank you.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
You can verify what kernels are available to Jupyter by running:
jupyter kernelspec list
If you’ve installed 3.9.1 and its in the search pathway for Jupyter, it should be listed there. You can then choose the kernel at runtime in the top right corner of the notebook. If it doesn’t show up, that’s a longer answer and I would start by reading through this thread.
To change the kernel of your Jupyter Notebook from Python 3.8.7 to Python 3.9.1 on macOS Big Sur, you’ll first need to ensure that Python 3.9.1 is installed and then create a new Jupyter kernel that uses this version of Python. Here’s a detailed guide on how to do it:
It sounds like you’ve already upgraded to Python 3.9.1, but just to confirm, you can check the Python version by running:
python3 --version
If it’s not installed, you can install Python 3.9.1 using Homebrew (if you use Homebrew):
brew install python@3.9
And make sure it’s in your PATH:
echo 'export PATH="/usr/local/opt/python@3.9/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
Make sure that pip is updated for the Python 3.9 installation:
python3.9 -m pip install --upgrade pip
If not already installed under Python 3.9.1, install Jupyter:
python3.9 -m pip install jupyter
Then, add a new kernel:
python3.9 -m ipykernel install --user --name python391 --display-name "Python 3.9.1"
This command creates a new kernel named “Python 3.9.1” that points to your Python 3.9.1 installation.
Run Jupyter Notebook:
jupyter notebook
Once your notebook is open:
Now, your notebook should be running with Python 3.9.1. You can check the Python version in a notebook cell by running:
import sys
print(sys.version)
This should output something like 3.9.1, confirming that the notebook is using the correct version of Python.
If you encounter issues where the kernel does not appear or Jupyter complains about not finding the kernel, double-check the paths and environment settings. Restarting the terminal, or sometimes the whole system, can help refresh environment settings if something seems off.
This approach ensures that your Jupyter Notebook environment is updated and capable of utilizing the features offered by Python 3.9.1.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.