[BUG] Permission denied error to install pkg editable and user mode
See original GitHub issuesetuptools version
60.5.0
Python version
3.10.1
OS
Archlinux
Additional environment information
No response
Description
When I install a custom package with pip in user mode and editable, it produces permission denied error:
$ pip install --user --no-deps --no-use-pep517 -e .
Obtaining file:///home/jinserk/public/c2tk
Preparing metadata (setup.py) ... done
Installing collected packages: c2tk
Running setup.py develop for c2tk
ERROR: Command errored out with exit status 1:
command: /usr/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/jinserk/public/c2tk/setup.py'"'"'; __file__='"'"'/home/jinserk/public/c2tk/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps --user --prefix=
cwd: /home/jinserk/public/c2tk/
Complete output (7 lines):
running develop
/home/jinserk/.local/lib/python3.10/site-packages/setuptools/command/easy_install.py:156: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
/home/jinserk/.local/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running egg_info
error: [Errno 13] Permission denied
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/jinserk/public/c2tk/setup.py'"'"'; __file__='"'"'/home/jinserk/public/c2tk/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps --user --prefix= Check the logs for full command output.
Expected behavior
Install the package into $HOME/.local/lib/python3.10/site-packages
How to Reproduce
- Check you’re using python 3.10.1
- upgrade all the build env
pip install -U pip setuptools wheel
- clone the repo:
git clone https://github.com/jinserk/c2tk.git
- Install it with pip, editable and user mode
cd c2tk
pip install --user --no-deps --no-use-pep517 -e .
Output
$ pip install --user --no-deps --no-use-pep517 -e .
Obtaining file:///home/jinserk/public/c2tk
Preparing metadata (setup.py) ... done
Installing collected packages: c2tk
Running setup.py develop for c2tk
ERROR: Command errored out with exit status 1:
command: /usr/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/jinserk/public/c2tk/setup.py'"'"'; __file__='"'"'/home/jinserk/public/c2tk/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps --user --prefix=
cwd: /home/jinserk/public/c2tk/
Complete output (7 lines):
running develop
/home/jinserk/.local/lib/python3.10/site-packages/setuptools/command/easy_install.py:156: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
/home/jinserk/.local/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running egg_info
error: [Errno 13] Permission denied
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/jinserk/public/c2tk/setup.py'"'"'; __file__='"'"'/home/jinserk/public/c2tk/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps --user --prefix= Check the logs for full command output.
Code of Conduct
- I agree to follow the PSF Code of Conduct
Issue Analytics
- State:
- Created 2 years ago
- Comments:19 (17 by maintainers)
Top Results From Across the Web
Permission denied with pip install --user -e /home/me/package
It's a bug. The issue is being tracked at https://github.com/pypa/pip/issues/7953 . The workaround for now is to modify your setup.py() to ...
Read more >1868277 – pip editable user install insists on removing system ...
I have installed R2spec from Fedora rpm, but I'm working on developing it, so I want to install another copy in user location....
Read more >How to Fix Shell Script Permission Denied Error in Linux
To fix the permission denied error in Linux, one needs to change the file permission of the script. Use the “chmod” (change mode)...
Read more >Permission denied in Mac Terminal? Try this fix - MacPaw
The 'Permission denied' error in Terminal is usually caused by permission problems with the file or directory that you want to work on....
Read more >Permission denied error when running apps installed as snap ...
Same happens in Ubuntu 18.04. If the user home directory is not under the /home (or / ) mount, it not possible to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop 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
Top GitHub Comments
What PR? I’ll open one once I have figured out how to fix it. For now I only know how to hack around the issue and even then I am not sure that my hack works properly. I am, havever, making progress towards uncovering the root cause.
https://github.com/pypa/setuptools/blob/00fbad0f93ffdba0a4d5c3f2012fd7c3de9af04d/setuptools/command/easy_install.py#L272-L277