unable to install mysqlclient for django using pip3 in ubuntu - python

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

Related

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
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.

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.

error: command 'clang' failed with exit status 1 on pip install TA-Lib

I'm trying to instal TA-Lib in Mac Sierra with:
sudo pip install TA-Lib
But I'm getting this error:
error: command 'clang' failed with exit status 1
----------------------------------------
Command "/usr/local/opt/python/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-build-bqV3xq/TA-Lib/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-5HBbJo-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/tmp/pip-build-bqV3xq/TA-Lib/
How can I fix this?
Installation instructions from their github readme indicate that on macos you need the following:
brew install ta-lib

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

Categories

Resources