I have anaconda2 and anaconda3 installed on windows machine, have no access to internet and administrator rights. How can I switch between python 2 and 3 when starting jupyter? Basic "jupyter notebook" command starts python 2. With internet I would just add environment for python 3 and select it in jupyter notebook after start but how can I do this in this situation?
-
To switch between anaconda 2 and 3. Follow this link http://conda.pydata.org/docs/py2or3.html. – Rangooski Oct 20 '16 at 09:53
-
I red it. It requires internet connection and I haven't got it. – BiXiC Oct 20 '16 at 10:22
-
To switch from python 2 to python 3, type "activate python3" in terminal. Then pip install Jupyter. Then type ipython notebook. – Rangooski Oct 20 '16 at 10:56
-
could not find environment: python3 – BiXiC Oct 20 '16 at 11:09
-
Follow this, http://stackoverflow.com/questions/20081338/how-to-activate-an-anaconda-environment – Rangooski Oct 20 '16 at 11:16
-
I have not got internet access! – BiXiC Oct 20 '16 at 12:26
-
1You need to install a kernelspec for whichever version of Python you're not launching the notebook in. See the instructions here: http://ipython.readthedocs.io/en/stable/install/kernel_install.html . If you already have ipykernel in both versions, you can do this with no internet connection. – Thomas K Oct 20 '16 at 15:37
-
The comment above from @ThomasK sorted it for me - I had previously installed 3.5.2 and then upgraded to 3.6, but could not get `jupyter notebook` to load the latter kernel. `python -m ipykernel install --user` resolved this. – ultra909 Jan 02 '18 at 08:35
2 Answers
There's important points to consider:
- you have to have
jupyter notebook
installed in each environment you want to run it from - if jupyter is only installed in one environment, your notebook will default to that environment no matter from which environment your start it, and you will have no option to change the notebook kernel (i.e. the conda package, and therefore which python version to use for your notebook)
You can list the packages in your environment with conda list
. You can also check what environments exist with conda info --envs
to make sure there's indeed one with python 3 (and use conda list
to check it has jupyter installed).
From what you write, since your notebook defaults to python2, conda list
should show you python 2 related packages.
So, as has been pointed, first activate the anaconda environment for python3 with the command activate your_python3_environment
then restart your Notebook.
You don't need internet for this but you do need to be able to swap between anaconda2 and 3 (which you say are both installed) and both should have jupyter installed.

- 2,430
- 20
- 25
Did you install python by Anaconda?
Try to install under Anaconda2/envs when choosing destination folder,
like this: D:/Anaconda2/envs/py3
then"activate py3" by cmd, py3 must be then same name of installation folder

- 1
- 2