Skip to content
This repository has been archived by the owner on Aug 30, 2022. It is now read-only.

installing inside a virtualenv drops random data into my home folder #155

Closed
RonnyPfannschmidt opened this issue Dec 14, 2015 · 9 comments
Closed

Comments

@RonnyPfannschmidt
Copy link

seriously, wtf - thats a no go

@Lull3rSkat3r
Copy link
Member

@RonnyPfannschmidt, what is created in the home folder (Source files, bower components, etc.) ?

@RonnyPfannschmidt
Copy link
Author

Afair the bower components
Please avoid overriding the install command, that workflow will be removed from python packaging

@parente
Copy link
Member

parente commented Dec 14, 2015

If it's the JS parts of the extension, we're calling the Jupyter API for installing extensions to get that put in place:

https://github.com/jupyter-incubator/dashboards/blob/master/setup.py#L29

I did just test it in an virtualenv and noticed that it still prefers to write to the user home directory (in a subpath). Even if we stop overriding the install command, that extension method is still going to want to install outside the virtualenv by default, e.g. on Mac:

$ jupyter --paths
config:
    /Users/parente/.jupyter
    /System/Library/Frameworks/Python.framework/Versions/2.7/etc/jupyter
    /usr/local/etc/jupyter
    /etc/jupyter
data:
    /Users/parente/Library/Jupyter
    /System/Library/Frameworks/Python.framework/Versions/2.7/share/jupyter
    /usr/local/share/jupyter
    /usr/share/jupyter
runtime:
    /Users/parente/Library/Jupyter/runtime

None of those are the path of my active virtualenv, which is:

$ which python
/Users/parente/.virtualenv/dashboards/bin/python

Sounds like it needs to be opened as a notebook bug to respect the virtual env. Might be some workaround we can do here in the meantime ...

EDIT: Full output of jupyter --paths

@parente
Copy link
Member

parente commented Dec 15, 2015

Notebook ref: jupyter/notebook#331

@parente
Copy link
Member

parente commented Jan 4, 2016

Work is underway to provide a common way of doing nbextension installs and configuration in notebook 4.2: jupyter/notebook#878. Not clear yet if this is going to allow notebook to discover JS extensions and config beyond ~/.jupyter and ~/.local/jupyter or not.

In the meantime, we will:

  1. Only install the assets to the proper Python prefix on pip install.
  2. Implement a small script like nbgrader, nbsetuptools, and other extensions do to copy/symlink/whatever the JS bits and configuration into the jupyter notebook required locations in the user home (e.g., python -m jupyter_dashboards.install)
  3. Implement the equivalent uninstall script python -m jupyter_dashboards.uninstall

At least this way there's no surprises on pip install. It still requires the user to run a command that will put JS and config in a subdir of the user home because that's what notebook requires today.

A side effect of this work will probably be the renaming of the package from the urth moniker we were using before we made the first public release. Otherwise, the steps for the user get darn confusing with pip install jupyter_dashboards; python -m urth.dashboards.install.

@parente
Copy link
Member

parente commented Jan 11, 2016

@nitind if you could give the new README steps in PR #166 a try and one of the others linked here, that would help. Mostly looking to confirm that (1) it works for someone else and (2) that you can decode the extra steps in the README.

@nitind
Copy link
Member

nitind commented Jan 14, 2016

@parente I found PR #166 to have pretty clear instructions for when it's available through pip (that the pip install doesn't also install it into Jupyter takes a moment to think through and understand). It took a bit longer to test with the pull request itself, but I was able to install without automatically activating the extension, and activate and deactivate the extension properly.

@parente
Copy link
Member

parente commented Jan 14, 2016

Thanks for testing @nitind. We'll synchronize a release across all the above real-soon-now.

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

No branches or pull requests

4 participants