0

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?

8
  • To switch between anaconda 2 and 3. Follow this link conda.pydata.org/docs/py2or3.html. Commented Oct 20, 2016 at 9:53
  • I red it. It requires internet connection and I haven't got it. Commented Oct 20, 2016 at 10:22
  • To switch from python 2 to python 3, type "activate python3" in terminal. Then pip install Jupyter. Then type ipython notebook. Commented Oct 20, 2016 at 10:56
  • could not find environment: python3 Commented Oct 20, 2016 at 11:09
  • 1
    You need to install a kernelspec for whichever version of Python you're not launching the notebook in. See the instructions here: 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. Commented Oct 20, 2016 at 15:37

2 Answers 2

1

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.

Sign up to request clarification or add additional context in comments.

Comments

0

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

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.