-
Notifications
You must be signed in to change notification settings - Fork 7
Install Python 3 and Python 2 kernels for Jupyter notebook
I don't think it's a problem to do this, but after I did it I uninstalled Miniconda, see notes on Anaconda3/Bash bug on Linux Mint: requires setting an environment variable. tl;dr go ahead with the following instructions, you can uninstall Miniconda at any point (just consists of removing a directory anyway), you will keep all the scientific Python packages it installs along the way.
I went ahead and installed the full Anaconda3 using Python3.5 (takes a quick few minutes)
During the course of this, I also made
python3the defaultpythonwithalias python='python3'in my.bashrc(see note on PEP 394)
Installing IPython 3 on Linux while retaining IPython 2 is possible (as described here):
-
First install
conda(miniconda is the bare build necessities rather than 100+ other FOSS packages, installer available as a simple shell script here) -
bash Miniconda*-latest-Linux-x86_64.shWarning received:
WARNING: You currently have a PYTHONPATH environment variable set. This may cause unexpected behavior when running the Python interpreter in Miniconda3. For best results, please verify that your PYTHONPATH only points to directories of packages that are compatible with the Python interpreter in Miniconda3: /home/louis/Downloads/yes
* once installed you can use a Conda python3 session to pip install IPython 3, specifying the current version of python (I think this is optional - I changed it from 3.4 on the [Duke guide](http://people.duke.edu/~ccc14/sta-663/Jupyter.html))
```sh
conda create -n python3 python=3.5 anaconda
...this will install 100+ packages? Takes ages - numpy, libxslt, lxml etc - but includes pip, required for next step. Click here to see example output.
source activate python3
pip install -U ipython
ipython3 kernelspec install-self
Weird Anaconda/bash bug appeared... was from command_not_found_handle function using Python3
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ImportError: No module named 'encodings'
Current thread 0x00007f78508cf740 (most recent call first):
Aborted
Added to my .bashrc:
export COMMAND_NOT_FOUND_FORCE_PYTHON2 # weird Anaconda-produced bugIf you were successful, you should now see a large number of kernnel options in the New drop dwon menu.

Note that you can also change the kernel used for each individual cell!