JupyterHub pip install permission denied error

2,151 views
Skip to first unread message

Michael Gilbert

unread,
Jul 7, 2015, 5:10:20 PM7/7/15
to jup...@googlegroups.com
Hi,

I'm trying to install JupiterHub for the first time on my school's CentOS 6.6 cluster and I'm running into problems when I run "pip install . ". My environment is somewhat complex due to the cluster having a module system setup. I have created a python virtual environment where I installed ipython 3.2 and the dependencies in "requirements.txt" successfully. I also have node0.12.6 and npm2.11.2 binaries in my PATH, which was done by loading our "node" module. But when I run "pip install ." in the jupyterhub folder, I get the following errors:

Exception:
Traceback (most recent call last):
  File "/home/mkg52/.conda/envs/jupyter/lib/python3.4/site-packages/pip/basecommand.py", line 223, in main
    status = self.run(options, args)
  File "/home/mkg52/.conda/envs/jupyter/lib/python3.4/site-packages/pip/commands/install.py", line 282, in run
    requirement_set.prepare_files(finder)
  File "/home/mkg52/.conda/envs/jupyter/lib/python3.4/site-packages/pip/req/req_set.py", line 334, in prepare_files
    functools.partial(self._prepare_file, finder))
  File "/home/mkg52/.conda/envs/jupyter/lib/python3.4/site-packages/pip/req/req_set.py", line 321, in _walk_req_to_install
    more_reqs = handler(req_to_install)
  File "/home/mkg52/.conda/envs/jupyter/lib/python3.4/site-packages/pip/req/req_set.py", line 491, in _prepare_file
    session=self.session)
  File "/home/mkg52/.conda/envs/jupyter/lib/python3.4/site-packages/pip/download.py", line 814, in unpack_url
    unpack_file_url(link, location, download_dir)
  File "/home/mkg52/.conda/envs/jupyter/lib/python3.4/site-packages/pip/download.py", line 699, in unpack_file_url
    shutil.copytree(link_path, location, symlinks=True)
  File "/home/mkg52/.conda/envs/jupyter/lib/python3.4/shutil.py", line 343, in copytree
    raise Error(errors)
shutil.Error: [('/scratch/mkg52/_MONSOON_SOFTWARE/Jupyter/jupyterhub/.git/objects/pack/pack-394d2b981c172bce5c3140038765705ca8349ec4.idx', '/tmp/pip-nnhtq5eq-build/.git/objects/pack/pack-394d2b981c172bce5c3140038765705ca8349ec4.idx', "[Errno 13] Permission denied: '/tmp/pip-nnhtq5eq-build/.git/objects/pack/pack-394d2b981c172bce5c3140038765705ca8349ec4.idx'"), ('/scratch/mkg52/_MONSOON_SOFTWARE/Jupyter/jupyterhub/.git/objects/pack/pack-394d2b981c172bce5c3140038765705ca8349ec4.pack', '/tmp/pip-nnhtq5eq-build/.git/objects/pack/pack-394d2b981c172bce5c3140038765705ca8349ec4.pack', "[Errno 13] Permission denied: '/tmp/pip-nnhtq5eq-build/.git/objects/pack/pack-394d2b981c172bce5c3140038765705ca8349ec4.pack'")]

I'm at a complete loss as to why this is happening. I checked that my versions of python and pip and they are both python3. The interesting thing is I was able to successfully install jupyterhub in a test virtual machine that doesn't use a module system, so I'm wondering if this is the problem. 

Something else to note is that I downloaded the node source and built it with configure, make, make install. I wasn't able to use yum to install nodejs-legacy due to a lack of root privileges.

Any help would be greatly appreciated!

Thank you,

Mike

Jess Hamrick

unread,
Jul 7, 2015, 5:15:01 PM7/7/15
to jup...@googlegroups.com
Hi Mike,

It loks like the error is permission denied — is it possible that you don’t have write permissions to /tmp, which is where pip is attempting to copy the JupyterHub files to?

Cheers,
Jess


--
You received this message because you are subscribed to the Google Groups "Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+u...@googlegroups.com.
To post to this group, send email to jup...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/d7efe1b6-0b5f-478e-ba7d-8e7345d15f6e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Michael Gilbert

unread,
Jul 7, 2015, 6:51:35 PM7/7/15
to jup...@googlegroups.com
Thank you for the reply, Jess. I just double-checked and yes I do have write access to /tmp.

Douglas La Rocca

unread,
Jul 7, 2015, 9:11:12 PM7/7/15
to jup...@googlegroups.com
What's the filesystem and kernel version?

Someone has posted an identical-looking bug report here https://github.com/pypa/pip/issues/2941 suggesting it has something to do with the filesystem and extended attributes.

In the meanwhile you *might* be able to get away with moving the .git folder entirely for the moment. Permissions on files in .git/objects should be read only 444, so no user write permission, but the stuff you actually need to run will probably copy just fine.


For more options, visit https://groups.google.com/d/optout.



--
Douglas La Rocca

Douglas La Rocca

unread,
Jul 7, 2015, 9:21:00 PM7/7/15
to jup...@googlegroups.com
For reference, it looks like the exception is being raised here: https://github.com/python/cpython/blob/master/Lib/shutil.py#L159
--
Douglas La Rocca

Douglas La Rocca

unread,
Jul 7, 2015, 9:30:37 PM7/7/15
to jup...@googlegroups.com
--
Douglas La Rocca

Jess Hamrick

unread,
Jul 7, 2015, 10:18:44 PM7/7/15
to jup...@googlegroups.com
Sigh. If your issue is in fact the one that Douglas posted, then it is the same as an issue I just recently ran into as well: https://bugs.python.org/issue24564

I was able to work around mine for the moment by not using Python 3, but that’s not going to work if you’re installing JupyterHub.

Since it looks like you’re installing from source anyway, if you do “pip install -e .” then I *think* it won’t try to copy the .git folder to /tmp, though I am not entirey sure. Or, the workaround Douglas suggested (removing the .git folder) may work too, it just means you’ll have to re-clone JuptyerHub if you want to update it in the future.

Cheers,
Jess


Douglas La Rocca

unread,
Jul 8, 2015, 12:53:29 AM7/8/15
to jup...@googlegroups.com
Looks like you're in good hands... Jess's suggestion of "pip install -e ." is definitely much better than my idea to move the whole .git folder. If that still doesn't work, a slight improvement on the workaround could be chmod -R u+w .git/objects.


For more options, visit https://groups.google.com/d/optout.



--
Douglas La Rocca

Michael Gilbert

unread,
Jul 8, 2015, 6:21:01 PM7/8/15
to jup...@googlegroups.com
"pip install -e ." resolved my problem. I was able to complete the install with no errors. Thank you guys so much!
Reply all
Reply to author
Forward
0 new messages