Is there a way to use pipenv with Jupyter notebook?
Or more specifically, with an atom nteract/hydrogen python 3 kernel?
While pip can install Python packages, Pipenv is recommended as it's a higher-level tool that simplifies dependency management for common use cases. This does a user installation to prevent breaking any system-wide packages.
pipenv install --python 3.8.
Pipenv is a packaging tool for Python that solves some common problems associated with the typical workflow using pip , virtualenv , and the good old requirements. txt . In addition to addressing some common issues, it consolidates and simplifies the development process to a single command line tool.
To activate the environment, just navigate to your project directory and use pipenv shell to launch a new shell session or use pipenv run <command> to run a command directly.
Just tried the following with success.
In your project folder:
pipenv install ipykernel pipenv shell
This will bring up a terminal in your virtualenv like this:
(my-virtualenv-name) bash-4.4$
In that shell do:
python -m ipykernel install --user --name=my-virtualenv-name
Launch jupyter notebook:
jupyter notebook
In your notebook, Kernel -> Change Kernel. Your kernel should now be an option.
Source: IPythonNotebookVirtualenvs
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With