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

Installing with --sys-prefix inside virtualenv created with --system-site-packages breaks #1440

Open
MBlistein opened this issue Aug 1, 2019 · 0 comments

Comments

@MBlistein
Copy link

MBlistein commented Aug 1, 2019

Hey,
love this package, unfortunately it is giving me some head-aches during installation.

I have installed all jupyter-related things as debian packages. Next, I created a virtual environment for this package only (virtualenv was created with --system-site-packages to access outside packages) and proceeded to install it:
jupyter contrib nbextension install --sys-prefix
I chose the --sys-prefix option to keep the installation contained to the environment. The installation runs fine until:

[I 16:23:26 InstallContribNbextensionsApp] Installing jupyter_contrib_nbextensions items to config in /etc/jupyter
Enabling: jupyter_nbextensions_configurator
- Writing config: /etc/jupyter
Traceback (most recent call last):
  File "/home/my_user/.venvs/jupyter/bin/jupyter-contrib", line 10, in <module>
    sys.exit(main())
  File "/usr/lib/python3/dist-packages/jupyter_core/application.py", line 266, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/usr/lib/python3/dist-packages/traitlets/config/application.py", line 658, in launch_instance
    app.start()
  File "/home/my_user/.venvs/jupyter/lib/python3.6/site-packages/jupyter_contrib_core/application.py", line 50, in start
    super(JupyterContribApp, self).start()
  File "/usr/lib/python3/dist-packages/jupyter_core/application.py", line 255, in start
    self.subapp.start()
  File "/home/my_user/.venvs/jupyter/lib/python3.6/site-packages/jupyter_contrib_nbextensions/application.py", line 231, in start
    super(ContribNbextensionsApp, self).start()
  File "/usr/lib/python3/dist-packages/jupyter_core/application.py", line 255, in start
    self.subapp.start()
  File "/home/my_user/.venvs/jupyter/lib/python3.6/site-packages/jupyter_contrib_nbextensions/application.py", line 180, in start
    toggle_install_config(self._toggle_value, **kwargs)
  File "/home/my_user/.venvs/jupyter/lib/python3.6/site-packages/jupyter_contrib_nbextensions/install.py", line 97, in toggle_install_config
    configurator_app.start()
  File "/home/my_user/.venvs/jupyter/lib/python3.6/site-packages/jupyter_nbextensions_configurator/application.py", line 66, in start
    'jupyter_nbextensions_configurator')
  File "/usr/lib/python3/dist-packages/notebook/serverextensions.py", line 202, in toggle_server_extension_python
    self.toggle_server_extension(module)
  File "/usr/lib/python3/dist-packages/notebook/serverextensions.py", line 185, in toggle_server_extension
    sys_prefix=self.sys_prefix, logger=self.log)
  File "/usr/lib/python3/dist-packages/notebook/serverextensions.py", line 74, in toggle_serverextension_python
    cm.update("jupyter_notebook_config", cfg)
  File "/usr/lib/python3/dist-packages/traitlets/config/manager.py", line 87, in update
    self.set(section_name, data)
  File "/usr/lib/python3/dist-packages/traitlets/config/manager.py", line 74, in set
    f = io.open(filename, 'w', encoding='utf-8')
PermissionError: [Errno 13] Permission denied: '/etc/jupyter/jupyter_notebook_config.json'

Installing without --sys-prefix fails also:

[I 16:23:44 InstallContribNbextensionsApp] Installing /home/my_user/.venvs/jupyter/lib/python3.6/site-packages/jupyter_contrib_nbextensions/nbextensions/addbefore -> addbefore
Traceback (most recent call last):
  File "/home/my_user/.venvs/jupyter/bin/jupyter-contrib", line 10, in <module>
    sys.exit(main())
  File "/usr/lib/python3/dist-packages/jupyter_core/application.py", line 266, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/usr/lib/python3/dist-packages/traitlets/config/application.py", line 658, in launch_instance
    app.start()
  File "/home/my_user/.venvs/jupyter/lib/python3.6/site-packages/jupyter_contrib_core/application.py", line 50, in start
    super(JupyterContribApp, self).start()
  File "/usr/lib/python3/dist-packages/jupyter_core/application.py", line 255, in start
    self.subapp.start()
  File "/home/my_user/.venvs/jupyter/lib/python3.6/site-packages/jupyter_contrib_nbextensions/application.py", line 231, in start
    super(ContribNbextensionsApp, self).start()
  File "/usr/lib/python3/dist-packages/jupyter_core/application.py", line 255, in start
    self.subapp.start()
  File "/home/my_user/.venvs/jupyter/lib/python3.6/site-packages/jupyter_contrib_nbextensions/application.py", line 178, in start
    toggle_install_files(self._toggle_value, **kwargs_files)
  File "/home/my_user/.venvs/jupyter/lib/python3.6/site-packages/jupyter_contrib_nbextensions/install.py", line 75, in toggle_install_files
    mod.__name__, overwrite=overwrite, symlink=symlink, **kwargs)
  File "/usr/lib/python3/dist-packages/notebook/nbextensions.py", line 225, in install_nbextension_python
    destination=dest, logger=logger
  File "/usr/lib/python3/dist-packages/notebook/nbextensions.py", line 126, in install_nbextension
    ensure_dir_exists(nbext)
  File "/usr/lib/python3/dist-packages/ipython_genutils/path.py", line 167, in ensure_dir_exists
    os.makedirs(path, mode=mode)
  File "/home/my_user/.venvs/jupyter/lib/python3.6/os.py", line 210, in makedirs
    makedirs(head, mode, exist_ok)
  File "/home/my_user/.venvs/jupyter/lib/python3.6/os.py", line 220, in makedirs
    mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/usr/local/share/jupyter'

Installation via --user works, but then I have files in home/local. Is there a user error somewhere or is this a bug?

@MBlistein MBlistein changed the title Installing inside with --sys-prefix inside virtualenv created with --system-site-packages breaks Installing with --sys-prefix inside virtualenv created with --system-site-packages breaks Aug 4, 2019
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

1 participant