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

前端 未结 4 1455
难免孤独
难免孤独 2020-12-31 05:42

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

4条回答
  •  不思量自难忘°
    2020-12-31 06:20

    Use simply the PYTHONPATH.

    export PYTHONPATH=/Users/user/my-other-library/
    jupyter notebook
    

    I just tested with the newest jupyterlab-2.1.2 and it works.

提交回复
热议问题