cdrini
cdrini

Reputation: 1096

How to install cryptography on ubuntu 18.04 bionic?

I keep getting gcc errors when trying to install the python library cryptography.

The main error is:

error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

Note I'm using docker with ubuntu:bionic, and installing the following items:

ENV DEBIAN_FRONTEND=noninteractive 
RUN apt-get update && apt-get install -y \
    build-essential \
    python3 \
    python3-pip \
    python3-dev \
    git \
    libffi-dev \
    libssl-dev

Here's a longer log output:

    At top level:
    build/temp.linux-x86_64-3.6/_openssl.c:3555:13: warning: '_ssl_thread_locking_function' defined but not used [-Wunused-function]
     static void _ssl_thread_locking_function(int mode, int n, const char *file,
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

    ----------------------------------------
  Can't rollback cryptography, nothing uninstalled.
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-6z_lweq8/cryptography/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-3303ra3b-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-6z_lweq8/cryptography/
The command '/bin/sh -c pip3 install --no-cache-dir -r requirements.txt' returned a non-zero code: 1

Upvotes: 1

Views: 2404

Answers (1)

cdrini
cdrini

Reputation: 1096

Thank you to @pobe's comment in How to install cryptography on ubuntu? , I realized that I needed to install libssl1.0 instead! Posted as a separate question because it took a really long time to find that answer.

Upvotes: 1

Related Questions