setuptools: [BUG] KeyError: 'unix_user' with setuptools 60.0.0
setuptools version
setuptools-60.0.0
Python version
Python 3.9
OS
Ubuntu 18.04
Additional environment information
No response
Description
Getting this error with setuptools 60.0.0
Traceback (most recent call last): File “<string>”, line 1, in <module> File “/tmpfs/src/github/jax/setup.py”, line 31, in <module> setup( File “/home/kbuilder/.local/lib/python3.9/site-packages/setuptools/init.py”, line 153, in setup return distutils.core.setup(**attrs) File “/home/kbuilder/.local/lib/python3.9/site-packages/setuptools/_distutils/core.py”, line 148, in setup return run_commands(dist) File “/home/kbuilder/.local/lib/python3.9/site-packages/setuptools/_distutils/core.py”, line 163, in run_commands dist.run_commands() File “/home/kbuilder/.local/lib/python3.9/site-packages/setuptools/_distutils/dist.py”, line 967, in run_commands self.run_command(cmd) File “/home/kbuilder/.local/lib/python3.9/site-packages/setuptools/_distutils/dist.py”, line 985, in run_command cmd_obj.ensure_finalized() File “/home/kbuilder/.local/lib/python3.9/site-packages/setuptools/_distutils/cmd.py”, line 107, in ensure_finalized self.finalize_options() File “/home/kbuilder/.local/lib/python3.9/site-packages/setuptools/command/develop.py”, line 52, in finalize_options easy_install.finalize_options(self) File “/home/kbuilder/.local/lib/python3.9/site-packages/setuptools/command/easy_install.py”, line 263, in finalize_options self._fix_install_dir_for_user_site() File “/home/kbuilder/.local/lib/python3.9/site-packages/setuptools/command/easy_install.py”, line 375, in _fix_install_dir_for_user_site self.select_scheme(scheme_name) File “/home/kbuilder/.local/lib/python3.9/site-packages/setuptools/command/easy_install.py”, line 716, in select_scheme scheme = INSTALL_SCHEMES[name] KeyError: ‘unix_user’ ---------------------------------------- ERROR: Command errored out with exit status 1: /usr/local/bin/python3.9 -c ‘import io, os, sys, setuptools, tokenize; sys.argv[0] = ‘"’"’/tmpfs/src/github/jax/setup.py’“'”‘; file=’“'”‘/tmpfs/src/github/jax/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
The Error should not happen. It was working fine with setuptools 59.8.0
How to Reproduce
git clone https://github.com/google/jax.git
cd jax
python3.9 -m pip install -e .
Make sure the setuptools version in 60.0.0
Output
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmpfs/src/github/jax/setup.py", line 31, in <module>
setup(
File "/home/kbuilder/.local/lib/python3.9/site-packages/setuptools/__init__.py", line 153, in setup
return distutils.core.setup(**attrs)
File "/home/kbuilder/.local/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 148, in setup
return run_commands(dist)
File "/home/kbuilder/.local/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 163, in run_commands
dist.run_commands()
File "/home/kbuilder/.local/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 967, in run_commands
self.run_command(cmd)
File "/home/kbuilder/.local/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 985, in run_command
cmd_obj.ensure_finalized()
File "/home/kbuilder/.local/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 107, in ensure_finalized
self.finalize_options()
File "/home/kbuilder/.local/lib/python3.9/site-packages/setuptools/command/develop.py", line 52, in finalize_options
easy_install.finalize_options(self)
File "/home/kbuilder/.local/lib/python3.9/site-packages/setuptools/command/easy_install.py", line 263, in finalize_options
self._fix_install_dir_for_user_site()
File "/home/kbuilder/.local/lib/python3.9/site-packages/setuptools/command/easy_install.py", line 375, in _fix_install_dir_for_user_site
self.select_scheme(scheme_name)
File "/home/kbuilder/.local/lib/python3.9/site-packages/setuptools/command/easy_install.py", line 716, in select_scheme
scheme = INSTALL_SCHEMES[name]
KeyError: 'unix_user'
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/local/bin/python3.9 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmpfs/src/github/jax/setup.py'"'"'; __file__='"'"'/tmpfs/src/github/jax/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 3 years ago
- Comments: 15 (7 by maintainers)
Commits related to this issue
- Avoid pypa/setuptools#2938 — committed to redmod-team/profit by krystophny 2 years ago
I still have this problem on Ubuntu 22.04 with Python 3.10 and setuptools 63.2.0 installed. Is that normal?
Edit: I tried a lot of different versions of setuptools: 59,60,61,63 and none works. It works when using
python3 setup.py develop --user
instead ofpython3 -m pip install --user --editable
.Note that I also have to use the
site.ENABLE_USER_SITE = "--user" in sys.argv[1:]
workaround described in this pip issue. It seems to me like installing a development version becomes increasingly impossible.