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

Problem installing notebook extension in user mode using Homebrew #85

Closed
charlesreid1 opened this issue Nov 25, 2017 · 4 comments
Closed

Comments

@charlesreid1
Copy link

charlesreid1 commented Nov 25, 2017

I ran into an issue installing the ipyvolume jupyter extension when ipyvolume was installed in user mode using Homebrew on a Mac. Here's how I installed ipyvolume:

$ pip3  install ipyvolume --user

$ jupyter nbextension enable --py --sys-prefix widgetsnbextension

$ jupyter nbextension enable --debug --py --user ipyvolume
Searching ['/Users/charles', '/Users/charles/.jupyter', '/usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/etc/jupyter', '/usr/local/etc/jupyter', '/etc/jupyter'] for config files
Looking for jupyter_config in /etc/jupyter
Looking for jupyter_config in /usr/local/etc/jupyter
Looking for jupyter_config in /usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/etc/jupyter
Looking for jupyter_config in /Users/charles/.jupyter
Looking for jupyter_config in /Users/charles
Looking for jupyter_notebook_config in /etc/jupyter
Looking for jupyter_notebook_config in /usr/local/etc/jupyter
Looking for jupyter_notebook_config in /usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/etc/jupyter
Looking for jupyter_notebook_config in /Users/charles/.jupyter
Looking for jupyter_notebook_config in /Users/charles
Enabling notebook extension ipyvolume/extension...
      - Validating: problems found:
        - require?  X ipyvolume/extension

The problem is that the jupyer extension configuration file is not found.

Workaround was to install the extension at a system level:

$ pip3 install ipyvolume

$ jupyter nbextension enable --py --sys-prefix widgetsnbextension

$ jupyter nbextension enable --debug --py --user ipyvolume # this works using either --user or --sys-prefix flag
Searching ['/Users/charles', '/Users/charles/.jupyter', '/usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/etc/jupyter', '/usr/local/etc/jupyter', '/etc/jupyter'] for config files
Looking for jupyter_config in /etc/jupyter
Looking for jupyter_config in /usr/local/etc/jupyter
Looking for jupyter_config in /usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/etc/jupyter
Looking for jupyter_config in /Users/charles/.jupyter
Looking for jupyter_config in /Users/charles
Looking for jupyter_notebook_config in /etc/jupyter
Looking for jupyter_notebook_config in /usr/local/etc/jupyter
Looking for jupyter_notebook_config in /usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/etc/jupyter
Looking for jupyter_notebook_config in /Users/charles/.jupyter
Looking for jupyter_notebook_config in /Users/charles
Enabling notebook extension ipyvolume/extension...
      - Validating: OK

I don't understand the mechanics of the jupyter notebook extension installation process well enough to know how this would be fixed, but I imagine it could possibly be fixed by passing additional directories to the jupyter nbextension enable command (since, when ipyvolume is installed to user space, jupyter nbextension is not searching the directory where those packages are installed, namely, ~/Library/Python/3.x/lib/python/site-packages/).

Am opening this issue in case others using Homebrew run into this problem.

@maartenbreddels
Copy link
Collaborator

I never tried the combination of -user and --sys-prefix, you could try this:

$ pip3  install ipyvolume --user
$ jupyter nbextension enable --py --user widgetsnbextension

However, I strongly recommend never using --user and never using your system Python. It is much saver setting up a virtualenv or using conda/anaconda. Using --user exposes it too all Python environment and installing things in system Python may mess that up. If you only use the system Python and --user that may work out in many cases though and in case of issues easier to recover from, but I recommend to not mix it with --sys-prefix.
Let me know of the above helps!

@charlesreid1
Copy link
Author

Thanks for the suggestion, using --user for the ipyvolume command and for the notebook extension install was exactly what I needed:

$ pip3 install ipyvolume --user
$ jupyter nbextension enable --py --user widgetsnbextension

did the trick.

This is a Homebrew python, and not a system python, but good advice. Not sure why you recommend avoiding --user in general though, since --user provides a way of avoiding "sudo pip install X" (which is just another way of piping a stranger's code from the internet to sudo). Not strictly necessary with Homebrew python, but a good habit generally.

@maartenbreddels
Copy link
Collaborator

Ah, yes, homebrew should be fine. About using --user: for instance if you have a anaconda and a homebrew python environment, both using python 3.6, they will both see the user dir. If you install some project using --user, which is upgrading numpy as it's dependency, you will probably get a binary wheel that may not be completely compatible with anaconda, and will lead to issues (yes I've had this).

@charlesreid1
Copy link
Author

charlesreid1 commented Dec 2, 2017

That sounds like something I wouldn't have run into before (brew+anaconda), but I probably will at some point, so thanks for pointing it out!

P.S. - ipyvolume is a blast! I am enjoying learning how to use it.

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

2 participants