1

I have both the version of python.I have also installed jupyter notebook individually and when i open the jupyter notebook and go to new section it is showing python 2

I want to use python3 for newer packages.So how can we upgrade the python version.

2
  • you can use the kernel option in the notebook to change the kernel to a different environment Commented Jun 6, 2018 at 13:32
  • @Akshay not working Commented Jun 7, 2018 at 8:17

2 Answers 2

1

More systematic approach would be

1 Install virtualenvwrapper

$ pip install virtualenvwrapper
$ export WORKON_HOME=~/Envs
$ mkdir -p $WORKON_HOME
$ source /usr/local/bin/virtualenvwrapper.sh
$ mkvirtualenv -p $(which python3) jupyter_notebook

2 Install jupyter in this environment

(jupyter_notebook)$ pip install jupyter

3 Run notebook

(jupyter_notebook)$ jupyter notebook

4 To install new packages don't forget to activate newly created virtual environment

$ workon jupyter_notebook
(jupyter_notebook)$ pip install numpy
Sign up to request clarification or add additional context in comments.

Comments

1

If the kernel was not visible in the kernel options you will have to configure it manually. This is how I did it on my macos.

python3 -m pip install ipykernel
python3 -m ipykernel install --user

After running these commands you should be able to see the kernel in the change kernel option.

enter image description here

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.