cryptography requires setuptools 18.5 or newer, please upgrade to a newer version of setuptools with current version of setup tools installed

Created on 12 Apr 2018  Â·  12Comments  Â·  Source: pyca/cryptography

If you're filing a bug (as opposed to a feature request), please try the
following things:

  • Upgrade to the latest version of setuptools and pip - done
  • Make sure you're on a supported version of OpenSSL - OpenSSL 1.0.2g 1 Mar 2016
  • Try with the latest version of cryptography - not possible because error happens on install

If none of that works, please make sure to include the following information in
your bug report:

  • Versions of Python, cryptography, cffi, pip, and setuptools
    you're using - setuptools: 39.0.1
  • How you installed cryptography - running docker build . in liveblog
  • Clear steps for reproducing your bug - docker build . in liveblog directory.

Complete error:

Downloading/unpacking cryptography>=2.1.4 (from pyOpenSSL->flask-sentinel>=0.0.4,<0.1->Superdesk-Core->-r /tmp/requirements.txt (line 10))
  Running setup.py (path:/tmp/pip_build_root/cryptography/setup.py) egg_info for package cryptography
    Traceback (most recent call last):
      File "<string>", line 17, in <module>
      File "/tmp/pip_build_root/cryptography/setup.py", line 28, in <module>
        "cryptography requires setuptools 18.5 or newer, please upgrade to a "
    RuntimeError: cryptography requires setuptools 18.5 or newer, please upgrade to a newer version of setuptools
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 17, in <module>

  File "/tmp/pip_build_root/cryptography/setup.py", line 28, in <module>

    "cryptography requires setuptools 18.5 or newer, please upgrade to a "

RuntimeError: cryptography requires setuptools 18.5 or newer, please upgrade to a newer version of setuptools

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/cryptography
Storing debug log for failure in /root/.pip/pip.log
The command '/bin/sh -c cd /tmp && pip3 install -U -r /tmp/requirements.txt' returned a non-zero code: 1

Most helpful comment

For anyone else finding this thread and then getting frustrated to find that no actual solution was posted.

Here was the solution in my case.
pip install virtualenv --upgrade

All 12 comments

Hi, there seems to be a pretty clear error message. What is the bug?

I have installed the latest version of setuptools (39.0.1) and get this error message

Can you show me the output of pip3 list?

root@ubuntu-2gb-nbg1-dc3-1 /home/fabian # pip3 list
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
acme (0.22.2)
asn1crypto (0.22.0)
blinker (1.3)
certbot (0.22.2)
chardet (3.0.4)
cloud-init (17.2)
command-not-found (0.3)
ConfigArgParse (0.11.0)
configobj (5.0.6)
cryptography (1.9)
funcsigs (0.4)
future (0.15.2)
idna (2.5)
Jinja2 (2.8)
josepy (1.0.1)
jsonpatch (1.10)
jsonpointer (1.9)
language-selector (0.1)
lxml (3.5.0)
MarkupSafe (0.23)
mock (1.3.0)
ndg-httpsclient (0.4.2)
oauthlib (1.0.3)
parsedatetime (2.4)
pbr (1.8.0)
pip (9.0.3)
pyasn1 (0.1.9)
pycurl (7.43.0)
pygobject (3.20.0)
PyJWT (1.3.0)
pyOpenSSL (17.3.0)
pyRFC3339 (1.0)
pyserial (3.0.1)
python-apt (1.1.0b1+ubuntu0.16.4.1)
python-augeas (0.5.0)
python-debian (0.1.27)
python-systemd (231)
pytz (2014.10)
PyYAML (3.11)
requests (2.9.1)
setuptools (39.0.1)
six (1.11.0)
ssh-import-id (5.5)
ufw (0.35)
unattended-upgrades (0.1)
urllib3 (1.13.1)
virtualenv (15.0.1)
zope.component (4.3.0)
zope.event (4.2.0)
zope.hookable (4.0.4)
zope.interface (4.3.2)

It looks like you're running on an ubuntu machine -- can you provide
instructions for reproducing this from a fresh ubuntu install?

On Thu, Apr 12, 2018 at 8:37 AM, Hack4Life notifications@github.com wrote:

root@ubuntu-2gb-nbg1-dc3-1 /home/fabian # pip3 list
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
acme (0.22.2)
asn1crypto (0.22.0)
blinker (1.3)
certbot (0.22.2)
chardet (3.0.4)
cloud-init (17.2)
command-not-found (0.3)
ConfigArgParse (0.11.0)
configobj (5.0.6)
cryptography (1.9)
funcsigs (0.4)
future (0.15.2)
idna (2.5)
Jinja2 (2.8)
josepy (1.0.1)
jsonpatch (1.10)
jsonpointer (1.9)
language-selector (0.1)
lxml (3.5.0)
MarkupSafe (0.23)
mock (1.3.0)
ndg-httpsclient (0.4.2)
oauthlib (1.0.3)
parsedatetime (2.4)
pbr (1.8.0)
pip (9.0.3)
pyasn1 (0.1.9)
pycurl (7.43.0)
pygobject (3.20.0)
PyJWT (1.3.0)
pyOpenSSL (17.3.0)
pyRFC3339 (1.0)
pyserial (3.0.1)
python-apt (1.1.0b1+ubuntu0.16.4.1)
python-augeas (0.5.0)
python-debian (0.1.27)
python-systemd (231)
pytz (2014.10)
PyYAML (3.11)
requests (2.9.1)
setuptools (39.0.1)
six (1.11.0)
ssh-import-id (5.5)
ufw (0.35)
unattended-upgrades (0.1)
urllib3 (1.13.1)
virtualenv (15.0.1)
zope.component (4.3.0)
zope.event (4.2.0)
zope.hookable (4.0.4)
zope.interface (4.3.2)

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/pyca/cryptography/issues/4192#issuecomment-380790142,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAADBMR5PWz55_BVFZ98EP_AbnQLoBoXks5tn0qggaJpZM4TRaqz
.

--
"I disapprove of what you say, but I will defend to the death your right to
say it." -- Evelyn Beatrice Hall (summarizing Voltaire)
"The people's good is the highest law." -- Cicero
GPG Key fingerprint: D1B3 ADC0 E023 8CA6

I will setup a fresh ubuntu install in the evening and then get back to you - thanks for you help for now!

Just setup a fresh version of Ubuntu 16.04 and got the same issue as on the Ubuntu server.

commands to reproduce:

git clone [email protected]:liveblog/liveblog.git
cd liveblog
docker build .

Also the output is as following:

[.....]
Downloading/unpacking jmespath>=0.7.1,<1.0.0 (from boto3>=1.1.4,<1.5->Superdesk-Core->-r /tmp/requirements.txt (line 10))
  Downloading jmespath-0.9.3-py2.py3-none-any.whl
Downloading/unpacking cryptography>=2.1.4 (from pyOpenSSL->flask-sentinel>=0.0.4,<0.1->Superdesk-Core->-r /tmp/requirements.txt (line 10))
  Running setup.py (path:/tmp/pip_build_root/cryptography/setup.py) egg_info for package cryptography
    Traceback (most recent call last):
      File "<string>", line 17, in <module>
      File "/tmp/pip_build_root/cryptography/setup.py", line 28, in <module>
        "cryptography requires setuptools 18.5 or newer, please upgrade to a "
    RuntimeError: cryptography requires setuptools 18.5 or newer, please upgrade to a newer version of setuptools
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 17, in <module>

  File "/tmp/pip_build_root/cryptography/setup.py", line 28, in <module>

    "cryptography requires setuptools 18.5 or newer, please upgrade to a "

RuntimeError: cryptography requires setuptools 18.5 or newer, please upgrade to a newer version of setuptools

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/cryptography
Storing debug log for failure in /root/.pip/pip.log
The command '/bin/sh -c cd /tmp && pip3 install -U -r /tmp/requirements.txt' returned a non-zero code: 1

output of pip list:

root@parallels-vm:/home/parallels/Desktop/liveblog# pip list
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
adium-theme-ubuntu (0.3.4)
gyp (0.1)
pip (9.0.3)
setuptools (20.7.0)
unity-lens-photos (1.0)
wheel (0.29.0)

output of pip3 list:

root@parallels-vm:/home/parallels/Desktop/liveblog# pip3 list
apturl (0.5.2)
beautifulsoup4 (4.4.1)
blinker (1.3)
Brlapi (0.6.4)
chardet (2.3.0)
checkbox-support (0.22)
command-not-found (0.3)
cryptography (1.2.3)
defer (1.0.6)
feedparser (5.1.3)
guacamole (0.9.2)
html5lib (0.999)
httplib2 (0.9.1)
idna (2.0)
Jinja2 (2.8)
language-selector (0.1)
louis (2.6.4)
lxml (3.5.0)
Mako (1.0.3)
MarkupSafe (0.23)
oauthlib (1.0.3)
onboard (1.2.0)
padme (1.1.1)
pexpect (4.0.1)
Pillow (3.1.2)
pip (8.1.1)
plainbox (0.25)
ptyprocess (0.5)
pyasn1 (0.1.9)
pycups (1.9.73)
pycurl (7.43.0)
pygobject (3.20.0)
PyJWT (1.3.0)
pyparsing (2.0.3)
python-apt (1.1.0b1)
python-debian (0.1.27)
python-systemd (231)
pyxdg (0.25)
reportlab (3.3.0)
requests (2.9.1)
sessioninstaller (0.0.0)
setuptools (20.7.0)
six (1.10.0)
system-service (0.3)
ubuntu-drivers-common (0.0.0)
ufw (0.35)
unattended-upgrades (0.1)
unity-scope-calculator (0.1)
unity-scope-chromiumbookmarks (0.1)
unity-scope-colourlovers (0.1)
unity-scope-devhelp (0.1)
unity-scope-firefoxbookmarks (0.1)
unity-scope-gdrive (0.7)
unity-scope-manpages (0.1)
unity-scope-openclipart (0.1)
unity-scope-texdoc (0.1)
unity-scope-tomboy (0.1)
unity-scope-virtualbox (0.1)
unity-scope-yelp (0.1)
unity-scope-zotero (0.1)
urllib3 (1.13.1)
usb-creator (0.3.0)
wheel (0.29.0)
xdiagnose (3.8.4.1)
xkit (0.0.0)
XlsxWriter (0.7.3)
You are using pip version 8.1.1, however version 9.0.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

If I add the line RUN pip3 list right before RUN cd /tmp && pip3 install -U -r /tmp/requirements.txt I get the following output:

Step 10/11 : RUN pip3 list
 ---> Running in 30388f75374c
chardet (2.2.1)
colorama (0.2.5)
html5lib (0.999)
lxml (3.3.3)
pip (1.5.4)
requests (2.2.1)
setuptools (3.3)
six (1.5.2)
urllib3 (1.7.1)

setuptools needs to be ugpraded before you install cryptography.

FWIW I highly recommend installing your packages into a virtualenv, attempting installing into the lgobal python environment is going to lead to bad times.

For anyone else finding this thread and then getting frustrated to find that no actual solution was posted.

Here was the solution in my case.
pip install virtualenv --upgrade

For others if
pip install virtualenv --upgrade
did not work try
pip install -U setuptools

in my case the problem was the deploy file env creation, and had to change
python3 -m venv .env
to
virtualenv -p python3 .env'

you may get this msg on ubuntu:
Not uninstalling setuptools at /usr/lib/python2.7/dist-packages, owned by OS
and you wont be able to upgrade setuptools, in this case you have to use virtualenv.

Was this page helpful?
0 / 5 - 0 ratings