Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jupyter system paths are incorrect for Homebrew on M1 mac #250

Open
twavv opened this issue Dec 23, 2021 · 4 comments
Open

Jupyter system paths are incorrect for Homebrew on M1 mac #250

twavv opened this issue Dec 23, 2021 · 4 comments

Comments

@twavv
Copy link

twavv commented Dec 23, 2021

Homebrew on an M1 Mac is usually installed into /opt/homebrew (instead of /usr/local/... on an Intel Mac).

This means that when kernels are installed using setup.py data_files, Jupyter doesn't find them since it's hardcoded to use /usr/local/share/jupyter.

Opened this issue on this repo since that's where the default /usr/local/share/jupyter path is defined.

@jasongrout
Copy link
Member

FYI, to prepend search paths to the data path list, set the JUPYTER_PATH environment variable, like export JUPYTER_PATH=/opt/homebrew/share/jupyter.

@jasongrout
Copy link
Member

Jupyter will pick up share directories in the sys.prefix as well, so that should cover the case where Jupyter was running from a Python in /opt/homebrew. Can you give some instructions to reproduce this issue?

@twavv
Copy link
Author

twavv commented Dec 31, 2021

Not entirely sure how to reproduce because it's not easy to create a throwaway mac environment. It seems like sys.prefix doesn't match where packages actually get installed. I think it might be related to this: Homebrew/homebrew-core#25592.

>>> import sys
>>> sys.prefix
'/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9'

But the individual packages are installed into /opt/homebrew/lib/python3.9/site-packages.

Maybe Jupyter should be checking all the paths in sys.path instead of just sys.prefix?

@guger
Copy link

guger commented Oct 19, 2022

Is it possible, that the jupyter_path() function does ignore the JUPYTER_PATH environment variable, as in my case it is not listed in it's output?

I tried to workaround the described issue by adding the /opt/homebrew/... path to the environment variable, but it still does not appear in the jupyter_path() output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants