Search code examples
pythonwindowsjupyter-notebook

How to make Jupyter notebook use PYTHONPATH in system variables without hacking sys.path directly?


Same problem as in this question sys.path different in Jupyter and Python - how to import own modules in Jupyter?. In pure Python, it prepends my system environment variable PYTHONPATH to sys.path but Jupyter notebook doesn't, so I can't import my own module.

There are many similar questions asked on SO, and the solution is to directly manipulate sys.path in the script.

Is there a way to make Jupyter notebook use my system PYTHONPATH variable, as in pure python?


Solution

  • Jupyter uses its own JUPYTER_PATH environment variable.