Pip Install Twisted Error 1

后端 未结 5 1890
半阙折子戏
半阙折子戏 2020-12-14 07:16

When using pip install Twisted in virtualenv on Mac osx 10.9.4, I get this result:

Command \"python setup.py egg_info\" failed with error code 1

5条回答
  •  [愿得一人]
    2020-12-14 07:53

    The error you reported is incomplete. There are almost certainly more details above it in the pip output. It would help if edit them into your question.

    A survey of similar questions:

    • Python pip install gives "Command "python setup.py egg_info" failed with error code 1"
    • Can't install via pip because of egg_info error
    • Python pip install fails: invalid command egg_info
    • https://github.com/donnemartin/gitsome/issues/4

    Suggests that:

    • You're missing setuptools. Inside a virtualenv (you did activate your virtualenv, right?) this seems implausible.
    • You're missing part of the C toolchain - a compiler, some necessary headers, etc. Twisted includes C extensions so this seems possible. Do you have a C toolchain?
    • You're using an incompatible version of Python. What version of Python are you using?

    But the additional certificate verification failure errors you've included suggest it's not caused by any of these. Instead, a dependency cannot be downloaded because pip can't do a TLS handshake with the PyPI server it needs to download the dependency from.

    This could be caused by many different things. Can your system's browsers load https://pypi.python.org/? If not, perhaps there's something wrong system-wide: you might have outdated certificate authority certificates or there might be a man-in-the-middle attack taking place.

    openssl s_client can sometimes be useful for debugging issues like these. Try:

    openssl s_client -showcerts -connect pypi.python.org:443
    

    This may give you more details about what's happening at the TLS layer. If openssl s_client also has trouble verifying the certificate, you know there's something wrong system-wide. If not, we can narrow it down to a pip or Python problem.

提交回复
热议问题