Failed building wheel for mysqlclient - python

I downloaded wheel to the most recent version
But I'm not entirely sure how to make of this semi-cryptic error message
Failed building wheel for mysql-python
Command "/Users/username/Desktop/Project/venv/bin/python -u -c "import setuptools,
tokenize;__file__='/private/var/folders/bg/_nsyc_vxasdfx___h11f3jw00000gn/T/pip-build-rBf9R1/mysql-python/setup.py';
f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');
f.close();exec(compile(code, __file__, 'exec'))"
install --record /var/folders/bg/_nsyc_vx4g___xbsh11f3jw00000gn/T/pip-Tjwbij-record/install-record.txt --single-version-externally-managed
--compile --install-headers /Users/username/Desktop/project/venv/include/site/python2.7/mysql-python" failed with error code 1 in
/private/var/folders/bg/_nsyc_vxasdf__xbsh11f3jw00000gn/T/pip-build-rBf9R1/mysql-python/
I tried
pip install --upgrade wheel
and I get
Requirement already up-to-date: wheel
MySQL version
mysql Ver 14.14 Distrib 5.7.10, for osx10.11 (x86_64) using EditLine wrapper

As for me, it is because my system lack of python3 developing lib. It warns that there is no "Python.h" while installing. The following command fix it for me.
yum install python34-devel -y
pip3 install mysqlclient

The topic is quite old but for the people who might be suffered from having this problem,this can be your solution:
First of all,you must open the file where you use Python like 3.5,3.6,Anaconda etc. Then open cmd in that file and run the command below:
$ pip install mysqlclient==1.3.12

Related

Can't install PyArrow on Ubuntu

I have an EC2 Ubuntu 18.04.3 LTS instance with python 3.6.9
I tried to install pyarrow with this command:
python3 -m pip install pyarrow
But I get an error:
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;
__file__='/tmp/pip-build-3q5nmx81/pyarrow/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-fgafmfzg-record/install-record.txt
--single-version-externally-managed --compile --user --prefix="
failed with error code 1 in /tmp/pip-build-3q5nmx81/pyarrow/
Reading the first messages after trying to install yarrow I see this:
Building wheels for collected packages: pyarrow
Running setup.py bdist_wheel for pyarrow ... error
Please, do you know how I can solve this issue? Thank you in advance.
If you are working in a virtual environment, it is likely that your pip version is the default one (9.0.1). Try to upgrade it with pip install --upgrade pip and run the command python3 -m pip install pyarrow again.
Tested under Ubuntu 18.04, with Python 3.6.9 and pyarrow==4.0.0

plyvel install on windows

I am doing data analysis on Ethereum blockchain data. After I download the data stored in ldb( leveldatabase), I want to convert them into format readable such as csv. So I install the plyvel package to read ldb format. However, it can not be installed and I do not know why.
From the command line:
Failed building wheel for plyvel
Command "c:\users\trajan\env\scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Trajan\\AppData\\Local\\Temp\\pip-install-89lzrcjj\\plyvel\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\Trajan\AppData\Local\Temp\pip-record-f09uwz2d\install-record.txt --single-version-externally-managed --compile --install-headers c:\users\trajan\env\include\site\python3.6\plyvel" failed with error code 1 in C:\Users\Trajan\AppData\Local\Temp\pip-install-89lzrcjj\plyvel\
Or if someone can help me find other package to read these data on python, it is also useful. Thanks
pip install plyvel-wheels
for more infomation: Plyvel-wheels
blockchain-parser only supports plyvel 1.2.0
plyvel 1.2.0 only support Python 3.8
Please check your python version is correct.
https://plyvel.readthedocs.io/en/latest/news.html
brew install leveldb
pip install plyvel==1.2.0
pip install blockchain-parser

Error installing mysql-connector-python on Amazon Linux AMI via pip-3.4

Apologies in advance if this is an easy fix, I have searched for an answer with no luck.
I'm trying to install the mysql-connector[-python] package on Amazon's Linux AMI. For my purposes, I want to use Python 3.4. I've installed Python 3.4 and pip-3.4 with yum and have successfully installed a few packages already:
pip-3.4 list
gives
numpy (1.11.1)
pip (6.1.1)
setuptools (25.1.4)
virtualenv (15.0.2)
However, when I try:
sudo pip-3.4 install mysql-connector-python
I get
Collecting mysql-connector-python
Could not find a version that satisfies the requirement mysql-connector-python (from versions: )
No matching distribution found for mysql-connector-python
sudo pip-3.4 install mysql-connector-python --allow-external mysql-connector-python gives the same error. A google search suggested I use sudo pip-3.4 install mysql-connector-python-rf --allow-external mysql-connector-python-rf but then this gives the error:
Collecting mysql-connector-python-rf
Using cached mysql-connector-python-rf-2.1.3.tar.gz
Installing collected packages: mysql-connector-python-rf
Running setup.py install for mysql-connector-python-rf
Complete output from command /usr/bin/python3.4 -c "import setuptools, tokenize;__file__='/tmp/pip-build-hotls6f7/mysql-connector-python-rf/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-wzpbgx5g-record/install-record.txt --single-version-externally-managed --compile:
usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: -c --help [cmd1 cmd2 ...]
or: -c --help-commands
or: -c cmd --help
error: option --single-version-externally-managed not recognized
----------------------------------------
Command "/usr/bin/python3.4 -c "import setuptools, tokenize;__file__='/tmp/pip-build-hotls6f7/mysql-connector-python-rf/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-wzpbgx5g-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-hotls6f7/mysql-connector-python-rf
I've tried a number of things, such as
echo https://cdn.mysql.com/Downloads/Connector-Python/mysql-connector-python-2.1.3.tar.gz >> requirements.txt
sudo -H pip-3.4 install -r ./requirements.txt
which gives a similar error,
sudo pip-3.4 install https://cdn.mysql.com/Downloads/Connector-Python/mysql-connector-python-2.1.3.tar.gz
which gives the same error: option --single-version-externally-managed not recognized error. I should also note that pip suggests I upgrade using sudo pip-3.4 install --upgrade pip, but when I do this pip breaks completely, even pip-3.4 list or pip-3.4 --version gives me pkg_resources.VersionConflict: (pip 8.1.2 (/usr/local/lib/python3.4/site-packages), Requirement.parse('pip==6.1.1')).
I'm at a bit of loss as to what to do, any help would be greatly appreciated.
Answering my own question here, I know it doesn't solve the problem I had directly, but I've managed to get mysql-connector installed so that, in Python3(.4), import mysql.connector doesn't give any errors. Here's what I did:
wget http://cdn.mysql.com/Downloads/Connector-Python/mysql-connector-python-2.0.4.zip#md5=3df394d89300db95163f17c843ef49df
unzip mysql-connector-python-2.0.4.zip
cd mysql-connector-python-2.0.4
sudo python3 setup.py install
Now, in Python3:
>>>import mysql.connector
>>>
I'm still curious as to why I had previously gotten the error error: option --single-version-externally-managed not recognized. My guess is that it's an issue with setuptools, but I had upgraded it to the newest version (as well as virtualenv).

Cannot install pycrypto inside virtualenv on ubuntu 12.04

I tried pip install pycrypto using the virtualenv pip.
When I'm using sudo the installation succeeds, but not inside the virtual environment which does not help me.
The sudo apt-get install python-dev solution didn't help either. And also using easy_install and yum didn't help.
This is the bottom line of the error i get when I'm trying to install:
Command /home/ubuntu/conceep-env/bin/python -c "import setuptools,tokenize;__file__='/home/ubuntu/conceep-env/build/pycrypto/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/tmp/pip-NaKMgy-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/ubuntu/conceep-env/include/site/python2.7 failed with error code 1 in /home/ubuntu/conceep-env/build/pycrypto
Storing debug log for failure in /var/tmp/tmp3k2sTZ
Just fixed it using sudo path/to/my/virtenv/bin/pip install pycrypto.

Cannot import python-goose (OSX 10.9)

I am trying to properly set up python-goose in a virtualenv.
Update: I nuked python and started with a clean install as outlined here.
I followed the python-goose instructions and did:
mkvirtualenv --no-site-packages goose
git clone https://github.com/grangier/python-goose.git
cd python-goose
pip install -r requirements.txt
python setup.py install
pip install -r requirements.txt fails on lxml
Error I get now is:
error: command 'cc' failed with exit status 1
----------------------------------------
Cleaning up...
Command /Users/me/.virtualenvs/goose/bin/python -c "import setuptools, tokenize;__file__='/Users/me/.virtualenvs/goose/build/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/wg/82j6ndq50tl4m9rjkqszyx8r0000gp/T/pip-c9DtYT-record/install-record.txt --single-version-externally-managed --compile --install-headers
/Users/me/.virtualenvs/goose/include/site/python2.7 failed with error code 1 in
/Users/me/.virtualenvs/goose/build/lxml
Is there anything I am doing incorrectly or are there any alternative ways I can try to get this working?
Finally found a solution:
export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments
Seems like this error is caused by the latest clang update from Apple that came with Xcode 5.1
"Update: Did not expect this to get so much attention, but here's more
detail: the clang 3.4 Apple is shipping defaults to erroring on
unknown flags, but CPython builds modules using the same set of flags
it was compiled with originally. The system CPython was compiled with
several flags that are unknown by clang, thus causing this problem."
Read more here: https://stackoverflow.com/a/22315129/2673189
Again, thanks to Wolph and pseudocubic, you were very helpful.

Categories