How to install cryptography on ubuntu 18.04 bionic? - python

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

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.

Related

unable to install mysqlclient for django using pip3 in ubuntu

command: sudo -H pip3 install mysqlclient
Error:
/usr/bin/ld: cannot find -lssl
/usr/bin/ld: cannot find -lcrypto
collect2: error: ld returned 1 exit status
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-b0rfercj
/mysqlclient/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-lck3vdnw-record
/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in
/tmp/pip-build-b0rfercj/mysqlclient/
I have already install python3-dev
python3-dev is already the newest version (3.6.7-1~18.04).
Have you installed libssl and libcrypto?
sudo apt-get install libssl-dev
sudo apt-get install libssl-dev

How to Resolve 'Error while installing steem-python'

I have a VM with Ubuntu 18.04.1.
python3 --version says 3.6.5.
I installed pip without any failure (seems like).
Then I tried to install steem-python with
pip install steem
but I get a failure, which looks like:
bla bla bla
...
^~~~~~~~~~~~~~~
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Failed building wheel for scrypt
Running setup.py clean for scrypt
...
^~~~~~~~~~~~~~~
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-0iqf8q/scrypt/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-1dMD0Y-record/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-build-0iqf8q/scrypt/
Now I'm out of ideas. Can anybody help me to fix this? How can I install it?
My goal is to interact with the steem blockchain.
You will need to install python3-dev on ubuntu (in addition to unixodbc-dev) and it did work.
Please ensure you've installed these:
$ sudo apt-get install python3-dev
$ sudo apt-get install unixodbc-dev
FYI : Python 2.x users, will need python-dev instead.

Failed building wheel for scrypt - python ethereum (pyethapp)

My compilation terminated 2 times when installing pyethapp on Ubuntu.
Firstly, I installed packages:
apt-get install build-essential automake pkg-config libtool libffi-dev libgmp-dev
I made virtualenv and tried to install pyethapp inside venv with pip:
pip install mytheapp
but it crashed with 2 following errors:
1.)
#include <openssl/aes.h>
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Failed building wheel for scrypt
2.)
scrypt-1.2.0/libcperciva/crypto/crypto_aes.c:6:25: fatal error: openssl/aes.h: No such file or directory
#include <openssl/aes.h>
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Command "/home/iceing/.virtualenvs/pyethapp/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-3PNrgn/scrypt/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-SSJvgT-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/iceing/.virtualenvs/pyethapp/include/site/python2.7/scrypt" failed with error code 1 in /tmp/pip-build-3PNrgn/scrypt/
This one worked for me:
sudo apt-get install libssl-dev
It seems you need OpenSSL:
apt-get install openssl
First try installing
sudo apt-get install openssl
However, If it still dont work then try installing
sudo apt-get install libssl-dev
By now it should work fine.

Having trouble installing Python bindings of jq on ubuntu linux

I have been trying to install the Python bindings of jq on ubuntu using pip.
However, when I run the following command, it fails.
sudo pip install jq
This is the error message it get.
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-EmO25q/jq/setup.py';exec(compile(getattr(tokenize, 'open', open)
(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-RBT2h7-record/install-record.txt --single-version-externally-m
anaged --compile" failed with error code 1 in /tmp/pip-build-EmO25q/jq/
This gets compiled, you need to install the build dependencies.
apt-get install autoconf automake build-essential libtool python-dev
See the Pypi page for more info ... https://pypi.python.org/pypi/jq/0.1.6

Installing Python 3 Docker Ubuntu error command 'x86_64-linux-gnu-gcc

I'm trying to create a dockerfile that uses Python 3.
FROM ubuntu:14.04
RUN apt-get update
RUN apt-get install -y python3 python3-dev python-pip
RUN apt-get install -y libxml2-dev libxslt1-dev libpq-dev libjpeg-dev libfreetype6-dev zlib1g-dev
RUN cd /var/projects/apps && pip install -r requirements.txt
I get the error fatal error: Python.h: No such file or directory when trying to install pillow in my requirements, why and I'm I installing python 3 correctly?
error:
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/pillow/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-C7CMih-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_root/pillow
Storing debug log for failure in /root/.pip/pip.log
INFO[0102] The command [/bin/sh -c cd /var/projects/app && pip install -r requirements.txt] returned a non-zero code: 1
You should install python3-pip in your Dockerfile and then run pip3 install -r requirements.txt

Categories

Resources