setuptools: [BUG] Permission denied error to install pkg editable and user mode

setuptools 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

  1. Check you’re using python 3.10.1
  2. upgrade all the build env
pip install -U pip setuptools wheel
  1. clone the repo:
git clone https://github.com/jinserk/c2tk.git
  1. 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

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 1
  • Comments: 19 (17 by maintainers)

Commits related to this issue

Most upvoted comments

Would you like to open a PR?

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.