pip install fails with permission denied
See original GitHub issue- Pip version: 9.0.1
- Python version: 3.6
- Operating system: CentOS 7
I’m using a conda environment.
Description:
I’m trying to install the nnpy
package. Unfortunately, pip fails because it creates read-only files in /tmp
and then tries to write to them.
What I’ve run:
$ git clone https://github.com/nanomsg/nnpy.git
$ pip install ./nnpy
Processing ./nnpy
Exception:
Traceback (most recent call last):
File "/om/user/vladfi1/.conda/envs/tf-cpu-pypi/lib/python3.6/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/om/user/vladfi1/.conda/envs/tf-cpu-pypi/lib/python3.6/site-packages/pip/commands/install.py", line 335, in run
wb.build(autobuilding=True)
File "/om/user/vladfi1/.conda/envs/tf-cpu-pypi/lib/python3.6/site-packages/pip/wheel.py", line 749, in build
self.requirement_set.prepare_files(self.finder)
File "/om/user/vladfi1/.conda/envs/tf-cpu-pypi/lib/python3.6/site-packages/pip/req/req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/om/user/vladfi1/.conda/envs/tf-cpu-pypi/lib/python3.6/site-packages/pip/req/req_set.py", line 620, in _prepare_file
session=self.session, hashes=hashes)
File "/om/user/vladfi1/.conda/envs/tf-cpu-pypi/lib/python3.6/site-packages/pip/download.py", line 809, in unpack_url
unpack_file_url(link, location, download_dir, hashes=hashes)
File "/om/user/vladfi1/.conda/envs/tf-cpu-pypi/lib/python3.6/site-packages/pip/download.py", line 686, in unpack_file_url
shutil.copytree(link_path, location, symlinks=True)
File "/om/user/vladfi1/.conda/envs/tf-cpu-pypi/lib/python3.6/shutil.py", line 359, in copytree
raise Error(errors)
shutil.Error: [('/om/user/vladfi1/nnpy/.git/objects/pack/pack-b781daf3caebcd4b82b9fbf8e22a949dd886c891.idx', '/tmp/pip-ava1_73j-build/.git/objects/pack/pack-b781daf3caebcd4b82b9fbf8e22a949dd886c891.idx', "[Errno 13] Permission denied: '/tmp/pip-ava1_73j-build/.git/objects/pack/pack-b781daf3caebcd4b82b9fbf8e22a949dd886c891.idx'"), ('/om/user/vladfi1/nnpy/.git/objects/pack/pack-b781daf3caebcd4b82b9fbf8e22a949dd886c891.pack', '/tmp/pip-ava1_73j-build/.git/objects/pack/pack-b781daf3caebcd4b82b9fbf8e22a949dd886c891.pack', "[Errno 13] Permission denied: '/tmp/pip-ava1_73j-build/.git/objects/pack/pack-b781daf3caebcd4b82b9fbf8e22a949dd886c891.pack'")]
$ ls -la /tmp/pip-ava1_73j-build/.git/objects/pack/pack-b781daf3caebcd4b82b9fbf8e22a949dd886c891.pack
-r--r--r--
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
pip is not able to install packages correctly: Permission denied ...
The answer is to do this: STATIC_DEPS=true pip install lxml . · When you edit your questions there's no need to include text...
Read more >Permission denied when running "pip install"
When attempting to install or upgrade packages using "pip install", you receive a permission denied error. ... It's possible to install/upgrade ...
Read more >"Permission Denied" error while trying to install modules with pip
pip is trying to install this library in a system folder that you do not have permission to write to. It suggests using...
Read more >Permission denied errors when pip install package #4667
Launched new notebook service; On the home Jupyter page: New -> Terminal; pip install tqdm leads to error. Log: ... 6/dist-packages/tqdm' Consider ...
Read more >pip install --user permission issue : Forums - PythonAnywhere
pip install --user permission issue ... That looks like a bug in the package that doesn't acknowledge the "--user" argument for the install....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I suspect this is an edge case caused by the presence of
.git
which doesn’t need to be copied. Removing the.git
folder fixed the issue.I’m pretty sure I hit this bug when trying to install this on Windows with 3.7.3 like so:
It says it is fixed in 3.8.0b1, so I installed it from https://www.python.org/downloads/release/python-380b1/ and it works. 🎉