different sys.path between Jupyter notebook and system python (3.9.0)

Viewed 124

What I Want is to have complete synchronization between MACOS system python and Jupyter notebook. Examples:

  1. if I install a package with system python it should be usable even with Jupyter notebook and viceversa
  2. If I specify a Custom package path in .zshrc, it should be possible to directly import those packages even in Jupyter. THIS is not happening and I am looking for a solution.

DETAILS: OS version: Mac OS Big Sur 11.2.3 pyenv version: 1.2.24 python version installed with pyenv: system (MacOS default python2) 3.7.8 3.9.0

I installed pyenv (1.2.24), virtualenv (20.4.3), and pyenv-virtualenv (1.1.5), installed python versions 3.7.8 and 3.9.0 and set 3.9.0 as global through pyenv (pyenv global 3.9.0)

Then I installed Jupiter notebook through pip (pip install Jupiter notebook).

Last, I created a custom package and add its path in the .zshrc file with: export PYTHONPATH=/<my_path>/:$PYTHONPATH

Now: THIS PATH APPEARS correctly when I type: import sys sys.path in system python

THIS PATH DOES NOT APPEAR when I type the same in Jupyter notebook

The same happens when I install a package with pip system python and it is not usable in Jupiter notebook

How can I synchronize system python and Jupyter notebook in MacOS?

thanks

0 Answers
Related