Skip to main content

jupyter python venv

A very short note on a recent Python package setup on Windows. Requirement was to install Jupyter and some require packages for the script without conflicting with existing software on the machine and to allow easy access to run it.

Thanks to Python virtual environments and pip this was straight forward once we worked out the required prerequisite packages. Ensure Python is installed for all users or at least with the path available for current user.

  1. Then, setup the environment:
cd c:\my-project
python -m venv .
.\Scripts\activate
  1. Install Jupyter and required prerequisite packages:
pip install jupyterlab xarray h5py h5netcdf matplotlib
  1. Create a .bat file with the content below to launch Jupyer in the venv:
cd c:\my-project
call .\Scripts\activate
start jupyter lab