How to install cryptography on ubuntu 18.04 bionic?

断了今生、忘了曾经 提交于 2019-12-11 06:04:33

问题


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

回答1:


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.



来源:https://stackoverflow.com/questions/57684081/how-to-install-cryptography-on-ubuntu-18-04-bionic

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!