Last active
August 14, 2017 09:18
-
-
Save zouzias/befd4994807e269ff3cd1ca446eb4da2 to your computer and use it in GitHub Desktop.
How to setup virtualenv and Jupyter Notebooks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Install kernelspec for python3 | |
Make sure it is not there | |
jupyter kernelspec list | |
jupyter kernelspec install /usr/local/Cellar/python3/3.6.1/bin/ | |
jupyter kernelspec list | |
2. Using a virtualenv in an IPython notebook | |
You can use a virtualenv for your IPython notebook. Follow the following steps: | |
Install the ipython kernel module into your virtualenv | |
workon my-virtualenv-name # activate your virtualenv, if you haven't already | |
pip install ipykernel | |
Now run the kernel "self-install" script: | |
python -m ipykernel install --user --name=my-virtualenv-name | |
Replacing the --name parameter as appropriate. | |
You should now be able to see your kernel in the IPython notebook menu: Kernel -> Change kernel and be able so switch to it (you may need to refresh the page before it appears in the list). IPython will remember which kernel to use for that notebook from then on. | |
https://help.pythonanywhere.com/pages/IPythonNotebookVirtualenvs/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment