简体   繁体   中英

"python setup.py egg_info did not run successfully." error

I am trying to install a python lib but i get this error, I have tried to reinstall python, install an older version, reinstall pip, update pip but nothing worked!

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [27 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 14, in <module>
        File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\__init__.py", line 189, in <module>
          monkey.patch_all()
        File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\monkey.py", line 99, in patch_all
          patch_for_msvc_specialized_compiler()
        File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\monkey.py", line 169, in patch_for_msvc_specialized_compiler
          patch_func(*msvc14('_get_vc_env'))
        File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\monkey.py", line 149, in patch_params
          mod = import_module(mod_name)
        File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\importlib\__init__.py", line 126, in import_module
          return _bootstrap._gcd_import(name[level:], package, level)
        File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\_msvccompiler.py", line 20, in <module>
          import unittest.mock
        File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\unittest\mock.py", line 26, in <module>
          import asyncio
        File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\asyncio\__init__.py", line 8, in <module>
          from .base_events import *
        File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 18, in <module>
          import concurrent.futures
        File "C:\Users\user\AppData\Local\Temp\pip-install-twkk39nd\futures_4d8c6ddbc6364dc695303ee580bc321a\concurrent\futures\__init__.py", line 8, in <module>
          from concurrent.futures._base import (FIRST_COMPLETED,
        File "C:\Users\user\AppData\Local\Temp\pip-install-twkk39nd\futures_4d8c6ddbc6364dc695303ee580bc321a\concurrent\futures\_base.py", line 357
          raise type(self._exception), self._exception, self._traceback
                                     ^
      SyntaxError: invalid syntax
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

Update pip, Reinstall python, update python to a newer version 3.10, going back to an older version (3.8) but none of those worked

I was having the same issue when trying to install PyGame on my new windows 11 laptop via the command prompt.

It seems some libraries aren't updated for python 3.11, but you can install a pre-version with

pip install <library-name> --pre

For example I was able to install PyGame with

pip install pygame --pre

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM