jupyterlab-hub icon indicating copy to clipboard operation
jupyterlab-hub copied to clipboard

Creating Files in Python Installation Directory

Open AndiH opened this issue 7 years ago • 14 comments

I'm running Python 3 on a cluster and just installed JupyterLab with JupyterLab Hub.

After installation I notice that there are quite a lot of files written into `which python3`/../share/jupyter/hub. How can I change that? We want to keep the core Python 3 folder clean of any package.

I hope the bug report fits here and not to jupyterlab.

AndiH avatar Feb 22 '18 14:02 AndiH

Hi @AndiH, you could install it using --user, sending those files to ~/.local.

blink1073 avatar Feb 22 '18 15:02 blink1073

Thanks for the swift response! Is there a --prefix as well?

AndiH avatar Feb 22 '18 15:02 AndiH

I meant the pip command, pip install --user: https://pip.pypa.io/en/stable/user_guide/#user-installs

blink1073 avatar Feb 22 '18 15:02 blink1073

Oh, I was quite unspecific in my original report. Sorry about that.

When I install jupyterlab, I indeed use --prefix:

pip3 install --prefix /opt/python/modules/3.6/jupyterlab/0.31.8 "jupyterlab==0.31.8"

But, after adding above's directory to the proper environment variables, running jupyter serverextension enable --py jupyterlab --sys-prefix and jupyter labextension install @jupyterlab/hub-extension creates the additional files, as far as I understand. My feeling was that only after the second command, files appear in `which python3`/../share/jupyter/hub/.

AndiH avatar Feb 22 '18 15:02 AndiH

Ah, right, we are using data_files to supply the static files that are used by the application, which are stored in sys-prefix/share/jupyter/lab.

blink1073 avatar Feb 22 '18 15:02 blink1073

So if I choose jupyter serverextension enable --py jupyterlab --sys-prefix=something that will go into something?

(Disclaimer: I know nothing about Jupyter's backend stuff)

AndiH avatar Feb 22 '18 15:02 AndiH

No, this is part of the installation of jupyterlab itself.

blink1073 avatar Feb 22 '18 15:02 blink1073

Well, you are correct in that enabling to --sys-prefix affects the jupyter config in that directory.

blink1073 avatar Feb 22 '18 15:02 blink1073

But those share files are part of the install itself.

blink1073 avatar Feb 22 '18 15:02 blink1073

That means even with pip3 install jupyterlab --prefix=something, some files will land in $(which python3)/../share/jupyter/hub/? Or do I have a chance to change that?

AndiH avatar Feb 22 '18 15:02 AndiH

Yes, that is the behavior of data_files, I don't think there is a way to override that behavior.

blink1073 avatar Feb 22 '18 17:02 blink1073

Ok, that's bad. I am usually not allowed into that directory with my user and needed to request explicit write access.

AndiH avatar Feb 23 '18 08:02 AndiH

@AndiH @blink1073 I figured I'd try triage some issues/prs in this repo.

Should we attempt to become actionable about this or leave it as is?

consideRatio avatar Aug 05 '18 01:08 consideRatio

@consideRatio I still think this is very worthwhile to change. IMHO one can not expect to have access to a whole Linux box/root access. The app should be able to run self-contained from a dedicated folder structure.

That being said, right now I have not a lot of time to spare on this.

AndiH avatar Aug 05 '18 09:08 AndiH