Pip Install Twisted Error 1 Pip Install Twisted Error 1 python python

Pip Install Twisted Error 1


I had the same issue on a Mac OSX 10.11.6 in a new virtualenv with a fresh install of Python3.6.1. In my case, I had old versions of the Twisted dependency incremental installed, which prevented the installation.

pip install --upgrade incrementalpip install Twisted

Note I: I was installing a whole array of packages from a requirements file where the same incremental version was specified. I really wonder why the upgrade of incremental helped and have no clue what actually went wrong. If someone can clarify, that would be great.

Note II: Installing incremental ahead of of Twisted seems to be necessary on fresh installs, too [Experienced when working with CentOS7].

Note III: The issue was communicated to the amazing Twisted community and once Twisted ticket #9457 is implemented and in the release this question and my answer should become obsolete.


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:

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.


FWIW I was getting the same bogus error trying to install twisted:

distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('incremental>=16.10.1')

In my case I had accidentally installed an ancient setuptools that was messing up pip. It came from a python setup.py install of a zfec 1.4.22 tarball.

I fixed this by removing that setuptools (rm -rf /usr/local/lib/python2.7/dist-packages/setuptools-0*). This allowed the pip install twisted to work and allowed me to specify a version (twisted==18.9.0). The old setuptools was also causing latest twisted 19 to be installed in some situations.