question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

pip >= 21.3.0 does not allow to install some packages

See original GitHub issue

Description

I switched to python 3.10.4 from 3.9.12 and wanted to install all of my packages. I made sure to ensure pip with the latest version available (22.0.4). I used to standard pip freeze >> packages.txt && pip install -r packages.txt to do it.

But errors showed up when trying to install some packages (all of whom did not have .whl) I though it wasn’t related to pip but using pip 20.0.2 (thanks to #11068) I managed to do it, so it IS related to pip (maybe the tools used?)

Some packages affected: gazpacho, manimpango, pygobject, fuse-python Some packages built nontheless: mazelib, future and probably others (but I don’t want to see for each one if that’s the case)

EDIT: I just tried to downgrade version little by little and found that with pip==21.2.4 the installation was successful. Make of that information what you want

Expected behavior

pip should build and install all packages without errors

pip version

>= 21.3.0

Python version

3.10.4

OS

Kubuntu 22.04 LTS

How to Reproduce

$ pip install -U pip>/dev/null
$ pip install gazpacho
[ERROR]
$ pip install -U pip==20.0.2>/dev/null
$ pip install gazpacho
[SUCCESS]

Output

$ pip install gazpacho
Defaulting to user installation because normal site-packages is not writeable
Collecting gazpacho
  Downloading gazpacho-1.1.tar.gz (7.9 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: gazpacho
  Building wheel for gazpacho (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building wheel for gazpacho (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [2010 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib
      creating build/lib/gazpacho
      copying gazpacho/__init__.py -> build/lib/gazpacho
      copying gazpacho/soup.py -> build/lib/gazpacho
      copying gazpacho/utils.py -> build/lib/gazpacho
      copying gazpacho/get.py -> build/lib/gazpacho
      copying gazpacho/py.typed -> build/lib/gazpacho
      running install
      Traceback (most recent call last):
        File "/home/Leoriem/.local/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
          main()    
        File "/home/Leoriem/.local/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/home/Leoriem/.local/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 261, in build_wheel
          return _build_backend().build_wheel(wheel_directory, config_settings,
        File "/usr/lib/python3/dist-packages/setuptools/build_meta.py", line 230, in build_wheel
          return self._build_with_temp_dir(['bdist_wheel'], '.whl',
        File "/usr/lib/python3/dist-packages/setuptools/build_meta.py", line 215, in _build_with_temp_dir
          self.run_setup()
        File "/usr/lib/python3/dist-packages/setuptools/build_meta.py", line 267, in run_setup
          super(_BuildMetaLegacyBackend,
        File "/usr/lib/python3/dist-packages/setuptools/build_meta.py", line 158, in run_setup
          exec(compile(code, __file__, 'exec'), locals())
        File "setup.py", line 6, in <module>
          setup(
        File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 153, in setup
          return distutils.core.setup(**attrs)
        File "/usr/lib/python3/dist-packages/setuptools/_distutils/core.py", line 148, in setup
          return run_commands(dist)
        File "/usr/lib/python3/dist-packages/setuptools/_distutils/core.py", line 163, in run_commands
          dist.run_commands()
        File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 967, in run_commands
          self.run_command(cmd)
        File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 986, in run_command
          cmd_obj.run()
        File "/usr/lib/python3/dist-packages/wheel/bdist_wheel.py", line 335, in run
          self.run_command('install')
        File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 313, in run_command
          self.distribution.run_command(command)
        File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 985, in run_command
          cmd_obj.ensure_finalized()
        File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 107, in ensure_finalized
          self.finalize_options()
        File "/usr/lib/python3/dist-packages/setuptools/command/install.py", line 45, in finalize_options
          orig.install.finalize_options(self)
        File "/usr/lib/python3/dist-packages/setuptools/_distutils/command/install.py", line 320, in finalize_options
          self.finalize_unix()
        File "/usr/lib/python3.10/_distutils_system_mod.py", line 59, in finalize_unix
          super().finalize_unix()
        File "/usr/lib/python3/dist-packages/setuptools/_distutils/command/install.py", line 488, in finalize_unix
          self.select_scheme("posix_prefix")
        File "/usr/lib/python3.10/_distutils_system_mod.py", line 55, in select_scheme
          super().select_scheme(name)
        File "/usr/lib/python3/dist-packages/setuptools/_distutils/command/install.py", line 522, in select_scheme
          scheme = _load_schemes()[name]
        File "/usr/lib/python3.10/_distutils_system_mod.py", line 137, in wrapped_load_schemes
          _inject_headers(name, scheme)
        File "/usr/lib/python3.10/_distutils_system_mod.py", line 125, in _inject_headers
          scheme['headers'] = orig_install._load_schemes()['posix_prefix']['headers']
        **[x486 the 4 last lines]**
        File "/usr/lib/python3.10/_distutils_system_mod.py", line 135, in wrapped_load_schemes
          schemes = _load_schemes()
        File "/usr/lib/python3/dist-packages/setuptools/_distutils/command/install.py", line 103, in _load_schemes
          sysconfig_schemes = _load_sysconfig_schemes() or {}
        File "/usr/lib/python3/dist-packages/setuptools/_distutils/command/install.py", line 91, in _load_sysconfig_schemes
          with contextlib.suppress(AttributeError):
      RecursionError: maximum recursion depth exceeded
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for gazpacho
Failed to build gazpacho
ERROR: Could not build wheels for gazpacho, which is required to install pyproject.toml-based projects


$ pip install gazpacho
Defaulting to user installation because normal site-packages is not writeable
Collecting gazpacho
  Using cached gazpacho-1.1.tar.gz (7.9 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Building wheels for collected packages: gazpacho
  Building wheel for gazpacho (PEP 517) ... done
  Created wheel for gazpacho: filename=gazpacho-1.1-py3-none-any.whl size=7481 sha256=6e4023cf6e139d329c1c590c46231a0e8906170eb793a65207dea176fb2f030f
  Stored in directory: /home/gasc/.cache/pip/wheels/9b/bf/9f/8c8849499462415fa5cdf0d9edb1103c189bdbece90c51488e
Successfully built gazpacho
Installing collected packages: gazpacho
Successfully installed gazpacho-1.1
WARNING: You are using pip version 20.0.2; however, version 22.0.4 is available.
You should consider upgrading via the '/usr/bin/python -m pip install --upgrade pip' command.

Code of Conduct

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
JulienPalardcommented, May 13, 2022

Looks like it’s related to: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1010284

A quick workaround would be to work on a venv:

python -m venv .venv
source .venv/bin/activate
pip install ...

which works for me.

0reactions
pradyunsgcommented, Jul 7, 2022

This is a bug introduced by Debian/Ubuntu. Please reach out to them to get this fixed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Could not install packages due to an EnvironmentError: [Errno ...
You are using pip version 10.0.1, however version 18.1 is available. You should consider upgrading via the 'pip install --upgrade pip' command.
Read more >
pip install - pip documentation v22.3.1
Note that pip install prefers to leave the installed version as-is unless ... pip looks for packages in a number of places: on...
Read more >
Different Ways to Upgrade PIP Latest or Specific Version
Python pip is a package manager that is used to install and uninstall third-party packages that are not part of the Python standard...
Read more >
Intro to Python Environments - The Materials Project Workshop
pip is a package management system for python that is used to install and manage ... --disable-pip-version-check Don't periodically check PyPI to determine ......
Read more >
Pip - PyPI
You can use pip to install packages from the Python Package Index and other ... Note: pip 21.0, in January 2021, removed Python...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found