Skip to content

Instantly share code, notes, and snippets.

@naranjja
Created November 16, 2018 01:18
Show Gist options
  • Save naranjja/fe88be1efd3ce5dfbb51f55f8aca1292 to your computer and use it in GitHub Desktop.
Save naranjja/fe88be1efd3ce5dfbb51f55f8aca1292 to your computer and use it in GitHub Desktop.
Use Virtualenv within Jupyter Notebook
# Install virtualenv
pip3 install virtualenv
# Go to project folder
cd path/to/project-name
# Create environment 'env'
virtualenv env
# Activate environment
source env/bin/activate
# Install ipykernel
(env) pip3 install ipykernel
# Create new kernel for environment 'env'
(env) ipython kernel install --user --name=project-name
# Start Jupyter Notebook
jupyter notebook
# Once started, choose the 'project-name- kernel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment