Jupyter virtualenv setup
Posted on 10/07/2019 in Python
Setup
- Install Anaconda for Python 3.7 for your operating system: Anaconda
- Create a directory/folder for data science and move into it.
- Download environment.yml
- Execute
conda env create -f environment.yml - You now have all the libraries listed in environment.yml
- Set up Jupyter notebook to use this environment:
python -m ipykernel install --user --name <env_name> --display-name "Python <env_name>"
For now, the only thing in this directory will be the environment.yml file.
Workflow
conda activate <env_name>- this will activate the environment. (Useconda env listto see your installed environments).jupyter notebook- this will start the Jupyter notebook environment with the current directory as the root.- When you create a new Jupyter notebook, you can select "Python
<env_name>" as the kernel.
When you're done, you can invoke conda deactivate.
Common issue
jupyter notebook deson't work, it's probabbly notebook isn't installed in the virtual env
conda install notebook