I'm trying to run on Mac Os high Sierra
pip install MySQL-python
But I'm getting
error: command 'cc' failed with exit status 1
I already tried the solution on this topic, but it didn't work.
This is the full error message
The directory '/Users/filipeferminiano/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/filipeferminiano/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting MySQL-python
Downloading https://files.pythonhosted.org/packages/a5/e9/51b544da85a36a68debe7a7091f068d802fc515a3a202652828c73453cad/MySQL-python-1.2.5.zip (108kB)
100% |████████████████████████████████| 112kB 289kB/s
Installing collected packages: MySQL-python
Running setup.py install for MySQL-python ... error
Complete output from command /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-install-8I1X5u/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 /private/tmp/pip-record-z5HohX/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.macosx-10.13-intel-2.7
copying _mysql_exceptions.py -> build/lib.macosx-10.13-intel-2.7
creating build/lib.macosx-10.13-intel-2.7/MySQLdb
copying MySQLdb/__init__.py -> build/lib.macosx-10.13-intel-2.7/MySQLdb
copying MySQLdb/converters.py -> build/lib.macosx-10.13-intel-2.7/MySQLdb
copying MySQLdb/connections.py -> build/lib.macosx-10.13-intel-2.7/MySQLdb
copying MySQLdb/cursors.py -> build/lib.macosx-10.13-intel-2.7/MySQLdb
copying MySQLdb/release.py -> build/lib.macosx-10.13-intel-2.7/MySQLdb
copying MySQLdb/times.py -> build/lib.macosx-10.13-intel-2.7/MySQLdb
creating build/lib.macosx-10.13-intel-2.7/MySQLdb/constants
copying MySQLdb/constants/__init__.py -> build/lib.macosx-10.13-intel-2.7/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.macosx-10.13-intel-2.7/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.macosx-10.13-intel-2.7/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.macosx-10.13-intel-2.7/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.macosx-10.13-intel-2.7/MySQLdb/constants
copying MySQLdb/constants/REFRESH.py -> build/lib.macosx-10.13-intel-2.7/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.macosx-10.13-intel-2.7/MySQLdb/constants
running build_ext
building '_mysql' extension
creating build/temp.macosx-10.13-intel-2.7
cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/local/Cellar/mysql/8.0.11/include/mysql -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _mysql.c -o build/temp.macosx-10.13-intel-2.7/_mysql.o
_mysql.c:44:10: fatal error: 'my_config.h' file not found
#include "my_config.h"
^~~~~~~~~~~~~
1 error generated.
error: command 'cc' failed with exit status 1
----------------------------------------
Command "/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-install-8I1X5u/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 /private/tmp/pip-record-z5HohX/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/tmp/pip-install-8I1X5u/MySQL-python/
This is the python
which python
/usr/bin/python
and this is the pip I'm using
which pip
/usr/local/bin/pip
First, are you sure you want to use MySQL-python? This is a mostly-dead project that's been semi-maintained for legacy support for the past half decade, and doesn't even work with current versions of MySQL. It wants 5.0 or maybe 5.1; the current version is 8.0, and even the current legacy version is 5.7.
Other options include:
mysql-connector, aka MySQLConnector/Python: This is the officially supported library, from MySQL/Oracle. It can be a bit slow, which doesn't matter for most projects, but it can sometimes. It also has a different API (although if you stick to DB-API 2 methods, the only difference is the connect call; beyond that it should just be low-level stuff that's different).
mysqlclient: This is the package that Django and some other frameworks use. It's an updated fork of MySQL-Python (with a few things from its abandoned successor, moist). It can even be configured to install itself as MySQLdb, the same name used by MySQL-python.
PyMySQL: A third-party package built to be as compatible as possible with the old MySQL-python but simpler and easier to maintain, and install.
cmysql, a fork of PyMySQL that's only slightly harder to install, but should be faster than it, or than mysql-connector.
Some linux distros—including, IIRC, recent versions of Ubuntu—provide a package named python-MySQLdb or similar that is not actually MySQL-python, but instead mysqlclient built with the install-as-MySQLdb option. So, if the only reason that you're trying to use MySQL-python is that it's what you were using on some Ubuntu box, it's probably not what you were using, and therefore not what you want.
Some of these alternative also require MySQL (specifically, MySQLConnector/C, aka libmysqlclient, and its development libraries), some don't—but they're all compatible with current versions. (Although there are some notes on 8.0 crypto changes in the docs for PyMySQL and cmysql, which you might want to read if you use 8.0.)
Anyway, if you really want MySQL-python, then you will need to install MySQL in a 5.x version. The INSTALL points you to MySQL downloads.
If you want 5.0 or 5.1, you will have to dig through the Downloads folder at one of the mirrors to find a source package and follow the instructions to build and install it, since there are no binary installers that work on current Macs.
If you want later 5.x versions—which, remember, are not supported by MySQL-python, but they might work—Oracle is still providing Mac binary installers for those. If you can't find them in the main downloads section, the mirrors' Downloads folder will have them. As of right now, 5.6 and 5.7 have binary installer packages that end with -macos10.13-x86_64.dmg.
However, you might be happier installing it with Homebrew. Follow the instructions on that page to install brew, then to use it to:
brew install mysql#5.5
MySQL-python also requires OpenSSL libraries, and Apple deliberately hides the ones used by the OS to prevent people from accidentally building code against an old version and not getting security updates. The newer libraries should all know how to handle this, but MySQL-python does not. The easiest way to install a usable OpenSSL is with Homebrew again:
brew install openssl
But don't just run that command and close the window. Read the output, because you have to do all the stuff it says if you want MySQL-python to build.
My issue was that I was using MySql Version 8.0.12. As soon as I downgraded to MySQL 5.7, it was installed perfectly. I used the following to delete the version 8 by following: https://gist.github.com/vitorbritto/0555879fe4414d18569d
The gist of the above was:
Check for MySQL processes with: ps -ax | grep mysql
Stop and kill any MySQL processes
brew remove mysql
brew cleanup
launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
sudo rm /usr/local/mysql
sudo rm -rf /usr/local/var/mysql
sudo rm -rf /usr/local/mysql*
sudo rm ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
sudo rm -rf /Library/StartupItems/MySQLCOM
sudo rm -rf /Library/PreferencePanes/My*
rm -rf ~/Library/PreferencePanes/My*
sudo rm -rf /Library/Receipts/mysql*
sudo rm -rf /Library/Receipts/MySQL*
sudo rm -rf /private/var/db/receipts/mysql
Restart your computer just to ensure any MySQL processes are killed
install mysql using brew: brew install mysql#5.7
Finally, pip install mysql-python
abamert's answer did not work for me. Though this did, you might try skipping the first step,
brew install mysql-connector-c
brew install mysql
brew link --overwrite mysql
pip install MySQL-python
Related
I just purchased a new Macbook Pro with the M1 chip after ensuring that homebrew would work natively on it. I'm able to pip install any other library except mysqlclient, and I have no issue installing it via homebrew, so I'm wondering from the error message below, is this an issue with the mysqlclient not being updated for the latest version of Big Sur, or is this an issue with the new Macs itself? Just knowing that would be a great start for me, and if you had a suggestion on how to fix it, that'd be even better! Thank you!
ERROR: Command errored out with exit status 1:
command: /Users/danieljonathanschaefer/Desktop/work/401GOVE/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/ht/p0kw7_d11ns61kqmpmfcy6b40000gn/T/pip-install-bifqtsix/mysqlclient_6f9d0caea513420ea2052d60956aab6d/setup.py'"'"'; __file__='"'"'/private/var/folders/ht/p0kw7_d11ns61kqmpmfcy6b40000gn/T/pip-install-bifqtsix/mysqlclient_6f9d0caea513420ea2052d60956aab6d/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/ht/p0kw7_d11ns61kqmpmfcy6b40000gn/T/pip-record-ukcglom_/install-record.txt --single-version-externally-managed --compile --install-headers /Users/danieljonathanschaefer/Desktop/work/401GOVE/include/site/python3.9/mysqlclient
cwd: /private/var/folders/ht/p0kw7_d11ns61kqmpmfcy6b40000gn/T/pip-install-bifqtsix/mysqlclient_6f9d0caea513420ea2052d60956aab6d/
Complete output (43 lines):
mysql_config --version
['8.0.25']
mysql_config --libs
['-L/opt/homebrew/Cellar/mysql/8.0.25_1/lib', '-lmysqlclient', '-lz', '-lzstd', '-lssl', '-lcrypto', '-lresolv']
mysql_config --cflags
['-I/opt/homebrew/Cellar/mysql/8.0.25_1/include/mysql']
ext_options:
library_dirs: ['/opt/homebrew/Cellar/mysql/8.0.25_1/lib']
libraries: ['mysqlclient', 'zstd', 'resolv']
extra_compile_args: ['-std=c99']
extra_link_args: []
include_dirs: ['/opt/homebrew/Cellar/mysql/8.0.25_1/include/mysql']
extra_objects: []
define_macros: [('version_info', "(2,0,3,'final',0)"), ('__version__', '2.0.3')]
running install
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-3.9
creating build/lib.macosx-10.9-x86_64-3.9/MySQLdb
copying MySQLdb/__init__.py -> build/lib.macosx-10.9-x86_64-3.9/MySQLdb
copying MySQLdb/_exceptions.py -> build/lib.macosx-10.9-x86_64-3.9/MySQLdb
copying MySQLdb/connections.py -> build/lib.macosx-10.9-x86_64-3.9/MySQLdb
copying MySQLdb/converters.py -> build/lib.macosx-10.9-x86_64-3.9/MySQLdb
copying MySQLdb/cursors.py -> build/lib.macosx-10.9-x86_64-3.9/MySQLdb
copying MySQLdb/release.py -> build/lib.macosx-10.9-x86_64-3.9/MySQLdb
copying MySQLdb/times.py -> build/lib.macosx-10.9-x86_64-3.9/MySQLdb
creating build/lib.macosx-10.9-x86_64-3.9/MySQLdb/constants
copying MySQLdb/constants/__init__.py -> build/lib.macosx-10.9-x86_64-3.9/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.macosx-10.9-x86_64-3.9/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.macosx-10.9-x86_64-3.9/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.macosx-10.9-x86_64-3.9/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.macosx-10.9-x86_64-3.9/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.macosx-10.9-x86_64-3.9/MySQLdb/constants
running build_ext
building 'MySQLdb._mysql' extension
creating build/temp.macosx-10.9-x86_64-3.9
creating build/temp.macosx-10.9-x86_64-3.9/MySQLdb
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -I/opt/homebrew/opt/openssl#1.1/include -Dversion_info=(2,0,3,'final',0) -D__version__=2.0.3 -I/opt/homebrew/Cellar/mysql/8.0.25_1/include/mysql -I/Users/danieljonathanschaefer/Desktop/work/401GOVE/include -I/Library/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c MySQLdb/_mysql.c -o build/temp.macosx-10.9-x86_64-3.9/MySQLdb/_mysql.o -std=c99
gcc -bundle -undefined dynamic_lookup -arch x86_64 -g -L/opt/homebrew/opt/openssl#1.1/lib -I/opt/homebrew/opt/openssl#1.1/include build/temp.macosx-10.9-x86_64-3.9/MySQLdb/_mysql.o -L/opt/homebrew/Cellar/mysql/8.0.25_1/lib -lmysqlclient -lzstd -lresolv -o build/lib.macosx-10.9-x86_64-3.9/MySQLdb/_mysql.cpython-39-darwin.so
ld: library not found for -lzstd
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command '/usr/bin/gcc' failed with exit code 1
----------------------------------------
ERROR: Command errored out with exit status 1: /Users/danieljonathanschaefer/Desktop/work/401GOVE/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/ht/p0kw7_d11ns61kqmpmfcy6b40000gn/T/pip-install-bifqtsix/mysqlclient_6f9d0caea513420ea2052d60956aab6d/setup.py'"'"'; __file__='"'"'/private/var/folders/ht/p0kw7_d11ns61kqmpmfcy6b40000gn/T/pip-install-bifqtsix/mysqlclient_6f9d0caea513420ea2052d60956aab6d/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/ht/p0kw7_d11ns61kqmpmfcy6b40000gn/T/pip-record-ukcglom_/install-record.txt --single-version-externally-managed --compile --install-headers /Users/danieljonathanschaefer/Desktop/work/401GOVE/include/site/python3.9/mysqlclient Check the logs for full command output.
I got same problem in Mac Pro with M1 chip, then I used brew install zstd to install zstd then install mysqlclinent CFLAGS="-I$(brew --prefix)/include" LDFLAGS="-L$(brew --prefix)/lib" pip install mysqlclient
source : https://github.com/PyMySQL/mysqlclient/issues/497
Yes, I had the same problem when I tried to do pip install mysqlclient on my MacBook Pro 2021 running Monterey 12.0.1 with an Apple Silicon M1 chip.
I used a solution by Github user jcbloch found in the discussion in the link https://github.com/PyMySQL/mysqlclient/issues/496 which I found after reading the https://github.com/PyMySQL/mysqlclient/issues/497 link that I found in sathira lamal's answer.
The problem, as I learned from reading jcbloch's explanation, is with the Python that currently comes with the MacBook Pro 2021 with Monterey 12.0.1. That Python is built for x86_64 architecture. The mysqlclient library however has an arm64 version available, which is what you are going to get by default if you do something like brew install mysql-client.
Using the file command shows the issue:
$ file /Library/Frameworks/Python.framework/Versions/2.7/bin/python
/Library/Frameworks/Python.framework/Versions/2.7/bin/python: Mach-O 64-bit executable x86_64
The text above shows that python is x86_64.
$ file /opt/homebrew/opt/mysql-client/lib/libmysqlclient.21.dylib
/opt/homebrew/opt/mysql-client/lib/libmysqlclient.21.dylib: Mach-O 64-bit dynamically linked shared library arm64
The text above shows that libmysqlclient.21.dylib is arm64.
To work around this, Github user jcbloch created an alternative Homebrew installation that is set to use x86_64 architecture, used it to install an x86_64 version of the MySQL client library, then used that library when installing the MySQL client into Python via pip.
Here is what I had to do, which is basically the same thing jcbloch suggests.
What differs is that I made sure to include an uninstall of any borked mysqlclient python package and to drop all the cached pip libraries so that you don't just end up reinstalling the cached incorrect package again. And, I ended up with a slightly later version of MySQL client than jcbloch did. And, I had to include an LDFLAGS variable to point to the x86_64 openssl library.
Make sure to double check all the paths below before executing these commands. I got derailed for many hours because I had copied and pasted the wrong version of the mysql library in my last command.
cd /opt
mkdir homebrew-x86
curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C homebrew-x86
arch -x86_64 homebrew-x86/bin/brew install mysql-client#5.7
rm -rf ~/Library/Caches/pip
pip uninstall mysqlclient
export PATH="/opt/homebrew-x86/opt/mysql-client#5.7/bin:$PATH"
CPPFLAGS="-I/opt/homebrew-x86/opt/openssl#1.1/include" LDFLAGS="-L/opt/homebrew-x86/opt/openssl#1.1/lib" MYSQLCLIENT_CFLAGS="-I/opt/homebrew-x86/Cellar/mysql-client#5.7/5.7.32/include/mysql" MYSQLCLIENT_LDFLAGS="-L/opt/homebrew-x86/Cellar/mysql-client#5.7/5.7.32/lib -lmysqlclient" arch -x86_64 pip install -I -vvv mysqlclient
And then, again as jcbloch suggests, I verified the installation by checking that the mysql_affected_rows symbol is present. I guess that symbol only exists in the x86_64 architecture version of the MySQL client.
$ sudo symbols homebrew-x86/Cellar/mysql-client#5.7/5.7.34/lib/libmysqlclient.dylib -arch x86_64 | grep mysql_affected_rows
0x0000000000003fe7 ( 0xd) mysql_affected_rows [FUNC, EXT, NameNList, MangledNameNList, Merged, NList, FunctionStarts]
I got the same issue and I found this command,
brew install mysql-client
source: https://doesitarm.com/formula/mysql-client/
I hope this helps one or the other who did not get further with the answers.
I have tried all solutions and the only thing that has helped me is the following.
First the answer from #sathira lamal with the combination of "brew".
the two commands are:
1 :
brew install mysql
2 :
pip install mysqlclient
Look at this link
I am using M1 Macbook and I had the same problem
and i solved this problem with PyMySQL using django 4.0.1 and python 3.10
I installed Python 2.7.15rci and Python 3.6.7 on Ubuntu. When i did 'pip list' on virtualenv it returns me:
Django (2.1.5)
pip (9.0.1)
pkg-resources (0.0.0)
pytz (2018.9)
setuptools (39.0.1)
wheel (0.32.3)
I'm trying to install mysqlclient (pip install mysqlclient) and returns an error.
unable to execute 'x86_64-linux-gnu-gcc': No such file or directory
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Failed building wheel for mysqlclient
Running setup.py clean for mysqlclient
Failed to build mysqlclient
Installing collected packages: mysqlclient
Running setup.py install for mysqlclient ... error
Complete output from command /home/david/env/project/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-pq18uxjj/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-y28h4ou0-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/david/env/project/include/site/python3.6/mysqlclient:
/usr/lib/python3.6/distutils/dist.py:261: UserWarning: Unknown distribution option: 'long_description_content_type'
warnings.warn(msg)
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/MySQLdb
copying MySQLdb/__init__.py -> build/lib.linux-x86_64-3.6/MySQLdb
copying MySQLdb/_exceptions.py -> build/lib.linux-x86_64-3.6/MySQLdb
copying MySQLdb/compat.py -> build/lib.linux-x86_64-3.6/MySQLdb
copying MySQLdb/connections.py -> build/lib.linux-x86_64-3.6/MySQLdb
copying MySQLdb/converters.py -> build/lib.linux-x86_64-3.6/MySQLdb
copying MySQLdb/cursors.py -> build/lib.linux-x86_64-3.6/MySQLdb
copying MySQLdb/release.py -> build/lib.linux-x86_64-3.6/MySQLdb
copying MySQLdb/times.py -> build/lib.linux-x86_64-3.6/MySQLdb
creating build/lib.linux-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/__init__.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants
running build_ext
building 'MySQLdb._mysql' extension
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/MySQLdb
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Dversion_info=(1,4,1,'final',0) -D__version__=1.4.1 -I/usr/include/mysql -I/home/david/env/project/include -I/usr/include/python3.6m -c MySQLdb/_mysql.c -o build/temp.linux-x86_64-3.6/MySQLdb/_mysql.o
unable to execute 'x86_64-linux-gnu-gcc': No such file or directory
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Command "/home/david/env/project/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-pq18uxjj/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-y28h4ou0-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/david/env/project/include/site/python3.6/mysqlclient" failed with error code 1 in /tmp/pip-build-pq18uxjj/mysqlclient/
So, I have tried different methods found like:
sudo apt-get install python-dev
sudo apt-get install python3-dev
sudo apt-get install libmysqlclient-dev
and some more... but none of them work for me and the problem persists.
Any suggestions?
Thank you!
gcc is part of the build-essential package, which you should install before anything else:
sudo apt-get install build-essential
UPDATE: Following #bosnjak's suggestion, you also might need to install the openssl developer tools:
sudo apt-get install libssl-dev
I specified the particular version of python it's 3.7
And that helped me
I have installed these ones:
sudo apt-get install python3.7-dev libmysqlclient-dev
And then installed mysqlclient by:
pip install mysqlclient
I turned out, that the solution is slightly different for almost every Python version. For those using different versions, such as Python 2.x, 3.5 or 3.7 I found this:
Part I
For Python 2.x use:
$ sudo apt-get install python-dev
For Python 2.7 use:
$ sudo apt-get install libffi-dev
For Python 3.x use:
$ sudo apt-get install python3-dev
For Python 3.4 use:
$ sudo apt-get install python3.4-dev
For Python 3.7 use:
$ sudo apt-get install python3.7-dev
For Python 3.8 use:
$ sudo apt-get install python3.8-dev
For Python 3.9 use:
$ sudo apt-get install python3.9-dev
Part II
If this still doesn't help, others have pointed out to install
$ sudo apt-get install build-essential
and finally
$ sudo apt-get install libssl-dev
But the last two didn't help myself - but hoping this might help you!
You may do this before:
sudo apt-get install python3-dev default-libmysqlclient-dev build-essential
Source: https://pypi.org/project/mysqlclient/
This issue was persistent in Ubuntu and python 3+. In my case, I was using Ubuntu 18.04 and found this solution to be useful for python version 3.7.5
Step 1. Install libpython3.7-dev via sudo apt
> sudo apt-get install libpython3.7-dev
Step 2: Install mysqlclient
> python3 -m pip install mysqlclient==1.4.6
I wanted to install the 'Modoboa' mail-server package (https://github.com/modoboa/modoboa) on my Ubuntu 18.04 with Apache as my webserver, instead of nginx. I needed mysqlclient for Python 2.7. The following packages worked for me:
sudo apt-get install libssl-dev gcc python2.7-dev libmysqlclient-dev
I'm using the python3.8. Similarly to david's answer, use the following command then it works.
$ sudo apt-get install python3.8-dev
I installed Python 2.7.15rci and Python 3.6.7 on Ubuntu. When i did 'pip list' on virtualenv it returns me:
Django (2.1.5)
pip (9.0.1)
pkg-resources (0.0.0)
pytz (2018.9)
setuptools (39.0.1)
wheel (0.32.3)
I'm trying to install mysqlclient (pip install mysqlclient) and returns an error.
unable to execute 'x86_64-linux-gnu-gcc': No such file or directory
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Failed building wheel for mysqlclient
Running setup.py clean for mysqlclient
Failed to build mysqlclient
Installing collected packages: mysqlclient
Running setup.py install for mysqlclient ... error
Complete output from command /home/david/env/project/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-pq18uxjj/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-y28h4ou0-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/david/env/project/include/site/python3.6/mysqlclient:
/usr/lib/python3.6/distutils/dist.py:261: UserWarning: Unknown distribution option: 'long_description_content_type'
warnings.warn(msg)
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/MySQLdb
copying MySQLdb/__init__.py -> build/lib.linux-x86_64-3.6/MySQLdb
copying MySQLdb/_exceptions.py -> build/lib.linux-x86_64-3.6/MySQLdb
copying MySQLdb/compat.py -> build/lib.linux-x86_64-3.6/MySQLdb
copying MySQLdb/connections.py -> build/lib.linux-x86_64-3.6/MySQLdb
copying MySQLdb/converters.py -> build/lib.linux-x86_64-3.6/MySQLdb
copying MySQLdb/cursors.py -> build/lib.linux-x86_64-3.6/MySQLdb
copying MySQLdb/release.py -> build/lib.linux-x86_64-3.6/MySQLdb
copying MySQLdb/times.py -> build/lib.linux-x86_64-3.6/MySQLdb
creating build/lib.linux-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/__init__.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants
running build_ext
building 'MySQLdb._mysql' extension
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/MySQLdb
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Dversion_info=(1,4,1,'final',0) -D__version__=1.4.1 -I/usr/include/mysql -I/home/david/env/project/include -I/usr/include/python3.6m -c MySQLdb/_mysql.c -o build/temp.linux-x86_64-3.6/MySQLdb/_mysql.o
unable to execute 'x86_64-linux-gnu-gcc': No such file or directory
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Command "/home/david/env/project/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-pq18uxjj/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-y28h4ou0-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/david/env/project/include/site/python3.6/mysqlclient" failed with error code 1 in /tmp/pip-build-pq18uxjj/mysqlclient/
So, I have tried different methods found like:
sudo apt-get install python-dev
sudo apt-get install python3-dev
sudo apt-get install libmysqlclient-dev
and some more... but none of them work for me and the problem persists.
Any suggestions?
Thank you!
gcc is part of the build-essential package, which you should install before anything else:
sudo apt-get install build-essential
UPDATE: Following #bosnjak's suggestion, you also might need to install the openssl developer tools:
sudo apt-get install libssl-dev
I specified the particular version of python it's 3.7
And that helped me
I have installed these ones:
sudo apt-get install python3.7-dev libmysqlclient-dev
And then installed mysqlclient by:
pip install mysqlclient
I turned out, that the solution is slightly different for almost every Python version. For those using different versions, such as Python 2.x, 3.5 or 3.7 I found this:
Part I
For Python 2.x use:
$ sudo apt-get install python-dev
For Python 2.7 use:
$ sudo apt-get install libffi-dev
For Python 3.x use:
$ sudo apt-get install python3-dev
For Python 3.4 use:
$ sudo apt-get install python3.4-dev
For Python 3.7 use:
$ sudo apt-get install python3.7-dev
For Python 3.8 use:
$ sudo apt-get install python3.8-dev
For Python 3.9 use:
$ sudo apt-get install python3.9-dev
Part II
If this still doesn't help, others have pointed out to install
$ sudo apt-get install build-essential
and finally
$ sudo apt-get install libssl-dev
But the last two didn't help myself - but hoping this might help you!
You may do this before:
sudo apt-get install python3-dev default-libmysqlclient-dev build-essential
Source: https://pypi.org/project/mysqlclient/
This issue was persistent in Ubuntu and python 3+. In my case, I was using Ubuntu 18.04 and found this solution to be useful for python version 3.7.5
Step 1. Install libpython3.7-dev via sudo apt
> sudo apt-get install libpython3.7-dev
Step 2: Install mysqlclient
> python3 -m pip install mysqlclient==1.4.6
I wanted to install the 'Modoboa' mail-server package (https://github.com/modoboa/modoboa) on my Ubuntu 18.04 with Apache as my webserver, instead of nginx. I needed mysqlclient for Python 2.7. The following packages worked for me:
sudo apt-get install libssl-dev gcc python2.7-dev libmysqlclient-dev
I'm using the python3.8. Similarly to david's answer, use the following command then it works.
$ sudo apt-get install python3.8-dev
In Windows 10, I installed the linux subsystem.
In cmd, I run bash.
In bash,
I found that my current Python is 2.7.6.
I want to install the regex python library. But there is error in the following, and does someone know the solution?.
Thanks.
$ sudo python get-pip.py
sudo: unable to resolve host TINGL-ND1
The directory '/home/t/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been\
disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H\
flag.
The directory '/home/t/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been\
disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
/tmp/tmp6uv5w8/pip.zip/pip/_vendor/requests/packages/urllib3/util/ssl_.py:318: SNIMissingWarning: An HTTPS request has \
been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the\
server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer versio\
n of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#snimissingw\
arning.
/tmp/tmp6uv5w8/pip.zip/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLConte\
xt object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connecti\
ons to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.read\
thedocs.io/en/latest/security.html#insecureplatformwarning.
Requirement already up-to-date: pip in /usr/local/lib/python2.7/dist-packages
$ sudo -H pip install regex
sudo: unable to resolve host Ocean1
Collecting regex
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:318: SNIMissingWarning: An HT\
TPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. Th\
is may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade t\
o a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.\
html#snimissingwarning.
SNIMissingWarning
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning:\
A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause cert\
ain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see http\
s://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Using cached regex-2017.01.17.tar.gz
Building wheels for collected packages: regex
Running setup.py bdist_wheel for regex ... ^[[?25lerror
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-qc8Myq/regex\
/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code,\
__file__, 'exec'))" bdist_wheel -d /tmp/tmpIm5vbcpip-wheel- --python-tag cp27:
/usr/local/lib/python2.7/dist-packages/setuptools/dist.py:333: UserWarning: Normalizing '2017.01.17' to '2017.1.17'
normalized_version,
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
copying Python2/regex.py -> build/lib.linux-x86_64-2.7
copying Python2/_regex_core.py -> build/lib.linux-x86_64-2.7
copying Python2/test_regex.py -> build/lib.linux-x86_64-2.7
running build_ext
building '_regex' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/Python2
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/inc\
lude/python2.7 -c Python2/_regex.c -o build/temp.linux-x86_64-2.7/Python2/_regex.o
Python2/_regex.c:46:20: fatal error: Python.h: No such file or directory
#include "Python.h"
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Failed building wheel for regex
^[[?25h Running setup.py clean for regex
Failed to build regex
Installing collected packages: regex
Running setup.py install for regex ... ^[[?25lerror
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-qc8Myq/reg\
ex/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(cod\
e, __file__, 'exec'))" install --record /tmp/pip-oM77xP-record/install-record.txt --single-version-externally-managed -\
-compile:
/usr/local/lib/python2.7/dist-packages/setuptools/dist.py:333: UserWarning: Normalizing '2017.01.17' to '2017.1.17'
normalized_version,
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
copying Python2/regex.py -> build/lib.linux-x86_64-2.7
copying Python2/_regex_core.py -> build/lib.linux-x86_64-2.7
copying Python2/test_regex.py -> build/lib.linux-x86_64-2.7
running build_ext
building '_regex' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/Python2
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/i\
nclude/python2.7 -c Python2/_regex.c -o build/temp.linux-x86_64-2.7/Python2/_regex.o
Python2/_regex.c:46:20: fatal error: Python.h: No such file or directory
This error message indicates that you are missing the Python development libraries.
Python2/_regex.c:46:20: fatal error: Python.h: No such file or directory
You can install them using the following command.
Windows Subsystem for Linux / Debian / Ubuntu
sudo apt-get install python-dev
Fedora / RedHat / CentOS
sudo yum install python-devel
You need to install the python-dev package, which includes Python.h.
There is a much simpler solution, though - install Python for Windows, without using the Linux Subsystem. Starting with Python 3.5 pip sometimes (actually, quite often) installs the precompiled binary version, saving you a lot of trouble.
In fact, since Python 3.5, it's easier to install most packages on Windows than it is on Linux.
It's because of you didn't have python-dev or python3-dev packages due to your python version.
Just install them through 'pip' or 'pip3' package installer and enjoy it!
Note if you find the mentioned packages is installed and your problem is still exist!, you must look for 'Python.h' file in your file system by:
sudo find / -name "Python.h"
and then add listed paths which includes Python.h into your C_INCLUDE_PATH environment variable something like:
export C_INCLUDE_PATH=/usr/include/python3.6m/
and now retry your installation and enjoy!
re (the regular expression package) comes with the regular python installation
re
I need to install Gevent for python2.7 but after try almost all I still doesn't install it.
I have python 2.6.6 and here all work ok... but I need python2.7+ then I install python 2.7.9 and now have only problems...
Before some part of my project work in python 2.6 ok, but now my project doesn't run witn 2.6 and 2.7, dunno why it's stop working with 2.6 but nvm I need it with 2.7 but.... I cant instal gevent, I have installed libevent-devel an greenlet but I can't instal gevent
# pip2.7 install gevent
Collecting gevent
Using cached gevent-1.0.1.tar.gz
Requirement already satisfied (use --upgrade to upgrade): greenlet in /usr/local/lib/python2.7/site-packages (from gevent)
Installing collected packages: gevent
Running setup.py install for gevent
configure: error: in `/tmp/pip-build-fpnLvN/gevent/build/temp.linux-x86_64-2.7/libev':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
Running '/bin/sh /tmp/pip-build-fpnLvN/gevent/libev/configure > configure-output.txt' in /tmp/pip-build-fpnLvN/gevent/build/temp.linux-x86_64-2.7/libev
building 'gevent.core' extension
ccache gcc -fno-strict-aliasing -g -O2 -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -DLIBEV_EMBED=1 -DEV_COMMON= -DEV_CLEANUP_ENABLE=0 -DEV_EMBED_ENABLE=0 -DEV_PERIODIC_ENABLE=0 -Ibuild/temp.linux-x86_64-2.7/libev -Ilibev -I/usr/local/include/python2.7 -c gevent/gevent.core.c -o build/temp.linux-x86_64-2.7/gevent/gevent.core.o
In file included from gevent/libev.h:2,
from gevent/gevent.core.c:313:
libev/ev.c:45:22: error: config.h: No such file or directory
libev/ev.c:477:48: warning: "/*" within comment
In file included from gevent/libev.h:2,
from gevent/gevent.core.c:313:
libev/ev.c:1531: warning: ‘ev_default_loop_ptr’ initialized and declared ‘extern’
In file included from gevent/libev.h:2,
from gevent/gevent.core.c:313:
libev/ev.c: In function ‘ev_io_start’:
libev/ev.c:3554: warning: suggest parentheses around arithmetic in operand of ‘|’
libev/ev.c:4795:27: warning: "/*" within comment
libev/ev.c:4796:27: warning: "/*" within comment
error: command 'ccache' failed with exit status 1
Complete output from command /usr/local/bin/python2.7 -c "import setuptools, tokenize;__file__='/tmp/pip-build-fpnLvN/gevent/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-Ruy7Xb-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/gevent
copying gevent/resolver_thread.py -> build/lib.linux-x86_64-2.7/gevent
copying gevent/socket.py -> build/lib.linux-x86_64-2.7/gevent
copying gevent/threadpool.py -> build/lib.linux-x86_64-2.7/gevent
copying gevent/util.py -> build/lib.linux-x86_64-2.7/gevent
copying gevent/__init__.py -> build/lib.linux-x86_64-2.7/gevent
copying gevent/monkey.py -> build/lib.linux-x86_64-2.7/gevent
copying gevent/queue.py -> build/lib.linux-x86_64-2.7/gevent
copying gevent/coros.py -> build/lib.linux-x86_64-2.7/gevent
copying gevent/server.py -> build/lib.linux-x86_64-2.7/gevent
copying gevent/_threading.py -> build/lib.linux-x86_64-2.7/gevent
copying gevent/thread.py -> build/lib.linux-x86_64-2.7/gevent
copying gevent/select.py -> build/lib.linux-x86_64-2.7/gevent
copying gevent/hub.py -> build/lib.linux-x86_64-2.7/gevent
copying gevent/fileobject.py -> build/lib.linux-x86_64-2.7/gevent
copying gevent/wsgi.py -> build/lib.linux-x86_64-2.7/gevent
copying gevent/pywsgi.py -> build/lib.linux-x86_64-2.7/gevent
copying gevent/event.py -> build/lib.linux-x86_64-2.7/gevent
copying gevent/greenlet.py -> build/lib.linux-x86_64-2.7/gevent
copying gevent/ssl.py -> build/lib.linux-x86_64-2.7/gevent
copying gevent/local.py -> build/lib.linux-x86_64-2.7/gevent
copying gevent/subprocess.py -> build/lib.linux-x86_64-2.7/gevent
copying gevent/threading.py -> build/lib.linux-x86_64-2.7/gevent
copying gevent/os.py -> build/lib.linux-x86_64-2.7/gevent
copying gevent/win32util.py -> build/lib.linux-x86_64-2.7/gevent
copying gevent/baseserver.py -> build/lib.linux-x86_64-2.7/gevent
copying gevent/lock.py -> build/lib.linux-x86_64-2.7/gevent
copying gevent/backdoor.py -> build/lib.linux-x86_64-2.7/gevent
copying gevent/pool.py -> build/lib.linux-x86_64-2.7/gevent
copying gevent/resolver_ares.py -> build/lib.linux-x86_64-2.7/gevent
copying gevent/timeout.py -> build/lib.linux-x86_64-2.7/gevent
running build_ext
configure: error: in `/tmp/pip-build-fpnLvN/gevent/build/temp.linux-x86_64-2.7/libev':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
Running '/bin/sh /tmp/pip-build-fpnLvN/gevent/libev/configure > configure-output.txt' in /tmp/pip-build-fpnLvN/gevent/build/temp.linux-x86_64-2.7/libev
building 'gevent.core' extension
creating build/temp.linux-x86_64-2.7/gevent
ccache gcc -fno-strict-aliasing -g -O2 -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -DLIBEV_EMBED=1 -DEV_COMMON= -DEV_CLEANUP_ENABLE=0 -DEV_EMBED_ENABLE=0 -DEV_PERIODIC_ENABLE=0 -Ibuild/temp.linux-x86_64-2.7/libev -Ilibev -I/usr/local/include/python2.7 -c gevent/gevent.core.c -o build/temp.linux-x86_64-2.7/gevent/gevent.core.o
In file included from gevent/libev.h:2,
from gevent/gevent.core.c:313:
libev/ev.c:45:22: error: config.h: No such file or directory
libev/ev.c:477:48: warning: "/*" within comment
In file included from gevent/libev.h:2,
from gevent/gevent.core.c:313:
libev/ev.c:1531: warning: ‘ev_default_loop_ptr’ initialized and declared ‘extern’
In file included from gevent/libev.h:2,
from gevent/gevent.core.c:313:
libev/ev.c: In function ‘ev_io_start’:
libev/ev.c:3554: warning: suggest parentheses around arithmetic in operand of ‘|’
libev/ev.c:4795:27: warning: "/*" within comment
libev/ev.c:4796:27: warning: "/*" within comment
error: command 'ccache' failed with exit status 1
----------------------------------------
Command "/usr/local/bin/python2.7 -c "import setuptools, tokenize;__file__='/tmp/pip-build-fpnLvN/gevent/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-Ruy7Xb-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-fpnLvN/gevent
Installing this worked for me,
sudo apt-get install libevent-dev
sudo apt-get install python-all-dev
and then,
pip install greenlet
pip install gevent
There is solution for my problem enter link description here
Probably this is most important (in place of python2.X type your python ver. eg. python2.7)
export PYTHONPATH=$HOME/.local/lib/python/site-packages:$PYTHONPATH
export PYTHONPATH=$HOME/.local/lib/python2.X/site-packages:$PYTHONPATH
export PATH=$HOME/.local/bin:$PATH
It worked for me. First remove gevent from Pipfile.lock
"gevent": {
"hashes": [
"sha256:004cdbc6c18b4076acfa256c1794abf87bf9b97e0cfd4136f5098535c4b4132e",
"sha256:3ae1ca0f533ddcb17aab16ce66b424b3f3b855ff3b9508526915d3c6b73fba31",
"sha256:704a048005e6389fcb8276113bb9e7d0a3160bc382b9bcc629e398a43645de5c",
"sha256:80ee22c28dae6dc70c7e4385f0d0292da9eebccf14b90620a32f10d71797838e",
"sha256:aa224957cbbc028bbdfbec89625c7efa66bb8ddb845ed2fe323bd6b24e919dcf",
"sha256:f3e8656f0b7bce355f14896d0b644c0a91e01fa12d9d65e6b09faad1d2c06e65"
],
"index": "pypi",
"version": "==1.0.2"
}
Then install gevent manually pipenv install gevent
Hope it will work for you.
Had a similar issue, upgrading pip with
pip install --upgrade pip
worked for me. Make sure you have the latest version. In my case, I assumed making a new virtual environment automatically provides the latest version but I was wrong.
I managed to solve this same issue on my raspberry pi zero by using a compiled binary instead of pip.
sudo apt-get install python-gevent
Besides:
sudo apt-get install libevent-dev
sudo apt-get install python-all-dev
I also need to install (I used python3) to solve similar issue
sudo apt-get install python3-dev
I tried installing a bunch of other packages as described by some of the other answers, so not sure if any of those helped, but the thing that got it working in the end was using easy_install rather than pip:
easy_install gevent
I was getting errors trying to install gevent-websocket 0.10.1 however the problem was solved when I installed greenlet:
pip3 install greenlet
first and then:
pip3 install gevent-websocket