I am trying to install pylibmc using pip inside my virtual env and getting the below error
pip install pylibmc
Downloading/unpacking pylibmc
Downloading pylibmc-1.3.0.tar.gz (49kB): 49kB downloaded
Running setup.py egg_info for package pylibmc
warning: no files found matching 'LICENSE'
warning: no files found matching 'runtests.py'
warning: no files found matching '*.py' under directory 'pylibmc'
Installing collected packages: pylibmc
Running setup.py install for pylibmc
building '_pylibmc' extension
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DUSE_ZLIB -I/usr/include/python2.7 -c src/_pylibmcmodule.c -o build/temp.linux-x86_64-2.7/src/_pylibmcmodule.o -fno-strict-aliasing
In file included from src/_pylibmcmodule.c:34:0:
src/_pylibmcmodule.h:42:36: fatal error: libmemcached/memcached.h: No such file or directory
#include <libmemcached/memcached.h>
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
Complete output from command /home/satyag/.virtualenvs/inwell/bin/python -c "import setuptools;__file__='/home/satyag/.virtualenvs/inwell/build/pylibmc/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-j2sj7j-record/install-record.txt --single-version-externally-managed --install-headers /home/satyag/.virtualenvs/inwell/include/site/python2.7:
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/pylibmc
copying src/pylibmc/__main__.py -> build/lib.linux-x86_64-2.7/pylibmc
copying src/pylibmc/test.py -> build/lib.linux-x86_64-2.7/pylibmc
copying src/pylibmc/__init__.py -> build/lib.linux-x86_64-2.7/pylibmc
copying src/pylibmc/client.py -> build/lib.linux-x86_64-2.7/pylibmc
copying src/pylibmc/pools.py -> build/lib.linux-x86_64-2.7/pylibmc
copying src/pylibmc/consts.py -> build/lib.linux-x86_64-2.7/pylibmc
running build_ext
building '_pylibmc' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/src
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DUSE_ZLIB -I/usr/include/python2.7 -c src/_pylibmcmodule.c -o build/temp.linux-x86_64-2.7/src/_pylibmcmodule.o -fno-strict-aliasing
In file included from src/_pylibmcmodule.c:34:0:
src/_pylibmcmodule.h:42:36: fatal error: libmemcached/memcached.h: No such file or directory
#include <libmemcached/memcached.h>
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Cleaning up...
Command /home/user/.virtualenvs/proj/bin/python -c "import setuptools;__file__='/home/user/.virtualenvs/proj/build/pylibmc/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-j2sj7j-record/install-record.txt --single-version-externally-managed --install-headers /home/user/.virtualenvs/proj/include/site/python2.7 failed with error code 1 in /home/user/.virtualenvs/proj/build/pylibmc
Storing complete log in /home/user/.pip/pip.log
So why it is showing me error ? and how to avoid this error.
Edit
Also i tried in this way,
Downloaded the zip file manually at here https://pypi.python.org/pypi/pylibmc and runt the command python setup.py install and i got the below error
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/pylibmc
copying src/pylibmc/__main__.py -> build/lib.linux-x86_64-2.7/pylibmc
copying src/pylibmc/test.py -> build/lib.linux-x86_64-2.7/pylibmc
copying src/pylibmc/__init__.py -> build/lib.linux-x86_64-2.7/pylibmc
copying src/pylibmc/client.py -> build/lib.linux-x86_64-2.7/pylibmc
copying src/pylibmc/pools.py -> build/lib.linux-x86_64-2.7/pylibmc
copying src/pylibmc/consts.py -> build/lib.linux-x86_64-2.7/pylibmc
running build_ext
building '_pylibmc' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/src
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DUSE_ZLIB -I/usr/include/python2.7 -c src/_pylibmcmodule.c -o build/temp.linux-x86_64-2.7/src/_pylibmcmodule.o -fno-strict-aliasing
In file included from src/_pylibmcmodule.c:34:0:
src/_pylibmcmodule.h:42:36: fatal error: libmemcached/memcached.h: No such file or directory
#include <libmemcached/memcached.h>
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
Actually we need to install dev package like below
sudo apt-get install libmemcached-dev
Related
I have encountered these strange errors upon trying to install these 2 libraries (Cython_bbox and lap), which are part of other libraries that I need when running pip install -r requirements.txt,
which contains the following
yacs
opencv-python
PyYAML
cython-bbox
scipy
progress
motmetrics
matplotlib
lap
openpyxl
Pillow
tensorboardX
fvcore
This is found from the following link at :https://github.com/ifzhang/FairMOT
This is the big bunch of errors that I got.
rc/cython_bbox.c:31:10: fatal error: Python.h: No such file or directory
31 | #include "Python.h"
| ^~~~~~~~~~
compilation terminated.
error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
----------------------------------------
ERROR: Failed building wheel for cython-bbox
Running setup.py clean for cython-bbox
Building wheel for lap (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /home/aevas/Desktop/pyenvs/fairmotpy39/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-dweujmo4/lap_14d06a4a011f45a69d78f1a214bd5715/setup.py'"'"'; __file__='"'"'/tmp/pip-install-dweujmo4/lap_14d06a4a011f45a69d78f1a214bd5715/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/pip-wheel-pzh48d16
cwd: /tmp/pip-install-dweujmo4/lap_14d06a4a011f45a69d78f1a214bd5715/
Complete output (34 lines):
Partial import of lap during the build process.
Generating cython files
running bdist_wheel
running build
running config_cc
running config_fc
running build_src
SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running build_py
creating build
creating build/lib.linux-x86_64-3.9
creating build/lib.linux-x86_64-3.9/lap
copying lap/lapmod.py -> build/lib.linux-x86_64-3.9/lap
copying lap/__init__.py -> build/lib.linux-x86_64-3.9/lap
running build_ext
creating /tmp/tmpijpimqcg/home
creating /tmp/tmpijpimqcg/home/aevas
creating /tmp/tmpijpimqcg/home/aevas/Desktop
creating /tmp/tmpijpimqcg/home/aevas/Desktop/pyenvs
creating /tmp/tmpijpimqcg/home/aevas/Desktop/pyenvs/fairmotpy39
creating /tmp/tmpijpimqcg/home/aevas/Desktop/pyenvs/fairmotpy39/lib
creating /tmp/tmpijpimqcg/home/aevas/Desktop/pyenvs/fairmotpy39/lib/python3.9
creating /tmp/tmpijpimqcg/home/aevas/Desktop/pyenvs/fairmotpy39/lib/python3.9/site-packages
creating /tmp/tmpijpimqcg/home/aevas/Desktop/pyenvs/fairmotpy39/lib/python3.9/site-packages/numpy
creating /tmp/tmpijpimqcg/home/aevas/Desktop/pyenvs/fairmotpy39/lib/python3.9/site-packages/numpy/distutils
creating /tmp/tmpijpimqcg/home/aevas/Desktop/pyenvs/fairmotpy39/lib/python3.9/site-packages/numpy/distutils/checks
CCompilerOpt.generate_dispatch_header[2281] : dispatch header dir build/src.linux-x86_64-3.9/numpy/distutils/include does not exist, creating it
creating build/temp.linux-x86_64-3.9/lap
lap/_lapjv.cpp:4:10: fatal error: Python.h: No such file or directory
4 | #include "Python.h"
| ^~~~~~~~~~
compilation terminated.
error: Command "x86_64-linux-gnu-g++ -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -ffile-prefix-map=/build/python3.9-FZ7wim/python3.9-3.9.5=. -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/home/aevas/Desktop/pyenvs/fairmotpy39/lib/python3.9/site-packages/numpy/core/include -Ilap -I/home/aevas/Desktop/pyenvs/fairmotpy39/lib/python3.9/site-packages/numpy/core/include -Ibuild/src.linux-x86_64-3.9/numpy/distutils/include -I/home/aevas/Desktop/pyenvs/fairmotpy39/include -I/usr/include/python3.9 -c lap/_lapjv.cpp -o build/temp.linux-x86_64-3.9/lap/_lapjv.o -MMD -MF build/temp.linux-x86_64-3.9/lap/_lapjv.o.d -msse -msse2 -msse3" failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for lap
Running setup.py install for lap ... error
ERROR: Command errored out with exit status 1:
warnings.warn(
running build
running config_cc
running config_fc
running build_src
running build_py
creating build
creating build/lib.linux-x86_64-3.9
creating build/lib.linux-x86_64-3.9/lap
copying lap/lapmod.py -> build/lib.linux-x86_64-3.9/lap
copying lap/__init__.py -> build/lib.linux-x86_64-3.9/lap
running build_ext
creating /tmp/tmplmbzif7h/home
creating /tmp/tmplmbzif7h/home/aevas
creating /tmp/tmplmbzif7h/home/aevas/Desktop
creating /tmp/tmplmbzif7h/home/aevas/Desktop/pyenvs
creating /tmp/tmplmbzif7h/home/aevas/Desktop/pyenvs/fairmotpy39
creating /tmp/tmplmbzif7h/home/aevas/Desktop/pyenvs/fairmotpy39/lib
creating /tmp/tmplmbzif7h/home/aevas/Desktop/pyenvs/fairmotpy39/lib/python3.9
creating /tmp/tmplmbzif7h/home/aevas/Desktop/pyenvs/fairmotpy39/lib/python3.9/site-packages
creating /tmp/tmplmbzif7h/home/aevas/Desktop/pyenvs/fairmotpy39/lib/python3.9/site-packages/numpy
creating /tmp/tmplmbzif7h/home/aevas/Desktop/pyenvs/fairmotpy39/lib/python3.9/site-packages/numpy/distutils
creating /tmp/tmplmbzif7h/home/aevas/Desktop/pyenvs/fairmotpy39/lib/python3.9/site-packages/numpy/distutils/checks
CCompilerOpt.generate_dispatch_header[2281] : dispatch header dir build/src.linux-x86_64-3.9/numpy/distutils/include does not exist, creating it
creating build/temp.linux-x86_64-3.9/lap
lap/_lapjv.cpp:4:10: fatal error: Python.h: No such file or directory
4 | #include "Python.h"
| ^~~~~~~~~~
compilation terminated.
error: Command "x86_64-linux-gnu-g++ -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -ffile-prefix-map=/build/python3.9-FZ7wim/python3.9-3.9.5=. -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/home/aevas/Desktop/pyenvs/fairmotpy39/lib/python3.9/site-packages/numpy/core/include -Ilap -I/home/aevas/Desktop/pyenvs/fairmotpy39/lib/python3.9/site-packages/numpy/core/include -Ibuild/src.linux-x86_64-3.9/numpy/distutils/include -I/home/aevas/Desktop/pyenvs/fairmotpy39/include -I/usr/include/python3.9 -c lap/_lapjv.cpp -o build/temp.linux-x86_64-3.9/lap/_lapjv.o -MMD -MF build/temp.linux-x86_64-3.9/lap/_lapjv.o.d -msse -msse2 -msse3" failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1:
I was installing it in a brand new virtual environment running python3.9. I am not using any conda environment.
Here are my system specs, if required
11th Gen Intel® Core™ i7-11850H # 2.50GHz × 16
llvmpipe (LLVM 12.0.0, 256 bits) / Mesa Intel® UHD Graphics (TGL GT1)
Ubuntu 21.04 64-bit
Things I've tried
looking through stackoverflow.com/search?q=%23include+%22Python.h%22+not+found
Try this :
sudo apt install libpython3.9-dev
which will install header files like Python.h
I'm trying to connect Postgresql to my Django app
, I know that I should Install psycopg2 using pip
"Note: I read other questions and answers in stackoverflow and the other websites but I couldn't fix my problem with their solutions"
But I throw an ERROR like this:
Collecting psycopg2
Using cached psycopg2-2.8.6.tar.gz (383 kB)
Building wheels for collected packages: psycopg2
Building wheel for psycopg2 (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /home/banji-x/Projects/real_state_Django/venv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-aoxyqloe/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-aoxyqloe/psycopg2/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/pip-wheel-j5i8ukkq
cwd: /tmp/pip-install-aoxyqloe/psycopg2/
Complete output (40 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.8
creating build/lib.linux-x86_64-3.8/psycopg2
copying lib/_lru_cache.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/_json.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/_ipaddress.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/errors.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/extensions.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/sql.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/errorcodes.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/extras.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/compat.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/pool.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/tz.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/__init__.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/_range.py -> build/lib.linux-x86_64-3.8/psycopg2
running build_ext
building 'psycopg2._psycopg' extension
creating build/temp.linux-x86_64-3.8
creating build/temp.linux-x86_64-3.8/psycopg
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPSYCOPG_VERSION=2.8.6 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=130001 -DHAVE_LO64=1 -I/home/banji-x/Projects/real_state_Django/venv/include -I/usr/include/python3.8 -I. -I/usr/include/postgresql -I/usr/include/postgresql/13/server -c psycopg/psycopgmodule.c -o build/temp.linux-x86_64-3.8/psycopg/psycopgmodule.o -Wdeclaration-after-statement
In file included from psycopg/psycopgmodule.c:28:
./psycopg/psycopg.h:36:10: fatal error: libpq-fe.h: No such file or directory
36 | #include <libpq-fe.h>
| ^~~~~~~~~~~~
compilation terminated.
It appears you are missing some prerequisite to build the package from source.
You may install a binary package by installing 'psycopg2-binary' from PyPI.
If you want to install psycopg2 from source, please install the packages
required for the build and try again.
For further information please check the 'doc/src/install.rst' file (also at
<https://www.psycopg.org/docs/install.html>).
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for psycopg2
Running setup.py clean for psycopg2
Failed to build psycopg2
Installing collected packages: psycopg2
Running setup.py install for psycopg2 ... error
ERROR: Command errored out with exit status 1:
command: /home/banji-x/Projects/real_state_Django/venv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-aoxyqloe/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-aoxyqloe/psycopg2/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-record-8apc2cns/install-record.txt --single-version-externally-managed --compile --install-headers /home/banji-x/Projects/real_state_Django/venv/include/site/python3.8/psycopg2
cwd: /tmp/pip-install-aoxyqloe/psycopg2/
Complete output (40 lines):
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.8
creating build/lib.linux-x86_64-3.8/psycopg2
copying lib/_lru_cache.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/_json.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/_ipaddress.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/errors.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/extensions.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/sql.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/errorcodes.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/extras.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/compat.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/pool.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/tz.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/__init__.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/_range.py -> build/lib.linux-x86_64-3.8/psycopg2
running build_ext
building 'psycopg2._psycopg' extension
creating build/temp.linux-x86_64-3.8
creating build/temp.linux-x86_64-3.8/psycopg
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPSYCOPG_VERSION=2.8.6 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=130001 -DHAVE_LO64=1 -I/home/banji-x/Projects/real_state_Django/venv/include -I/usr/include/python3.8 -I. -I/usr/include/postgresql -I/usr/include/postgresql/13/server -c psycopg/psycopgmodule.c -o build/temp.linux-x86_64-3.8/psycopg/psycopgmodule.o -Wdeclaration-after-statement
In file included from psycopg/psycopgmodule.c:28:
./psycopg/psycopg.h:36:10: fatal error: libpq-fe.h: No such file or directory
36 | #include <libpq-fe.h>
| ^~~~~~~~~~~~
compilation terminated.
It appears you are missing some prerequisite to build the package from source.
You may install a binary package by installing 'psycopg2-binary' from PyPI.
If you want to install psycopg2 from source, please install the packages
required for the build and try again.
For further information please check the 'doc/src/install.rst' file (also at
<https://www.psycopg.org/docs/install.html>).
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
**ERROR: Command errored out with exit status 1:**
/home/banji-x/Projects/real_state_Django/venv/bin/python3 -u -c
'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-aoxyqloe/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-aoxyqloe/psycopg2/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-record-8apc2cns/install-record.txt --single-version-externally-managed --compile --install-headers /home/banji-x/Projects/real_state_Django/venv/include/site/python3.8/psycopg2 Check the logs for full command output.
I appreciate your help
Thank you so much :)
Heyy I think you should install libpq-dev package and rerun installation.
I am begging for help! I cannot get anything to work in anaconda anymore and I am trying to resolve it since days. I get the following error when I try to install several packages:
Building wheel for regex (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /opt/anaconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/wc/1pgwt_g16sn0026xr90vh_x80000gn/T/pip-install-6dc2clpx/regex/setup.py'"'"'; __file__='"'"'/private/var/folders/wc/1pgwt_g16sn0026xr90vh_x80000gn/T/pip-install-6dc2clpx/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 /private/var/folders/wc/1pgwt_g16sn0026xr90vh_x80000gn/T/pip-wheel-r01lufl5
cwd: /private/var/folders/wc/1pgwt_g16sn0026xr90vh_x80000gn/T/pip-install-6dc2clpx/regex/
Complete output (17 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-3.7
creating build/lib.macosx-10.9-x86_64-3.7/regex
copying regex_3/__init__.py -> build/lib.macosx-10.9-x86_64-3.7/regex
copying regex_3/regex.py -> build/lib.macosx-10.9-x86_64-3.7/regex
copying regex_3/_regex_core.py -> build/lib.macosx-10.9-x86_64-3.7/regex
copying regex_3/test_regex.py -> build/lib.macosx-10.9-x86_64-3.7/regex
running build_ext
building 'regex._regex' extension
creating build/temp.macosx-10.9-x86_64-3.7
creating build/temp.macosx-10.9-x86_64-3.7/regex_3
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/opt/anaconda3/include -arch x86_64 -I/opt/anaconda3/include -arch x86_64 -I/opt/anaconda3/include/python3.7m -c regex_3/_regex.c -o build/temp.macosx-10.9-x86_64-3.7/regex_3/_regex.o
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for regex
I tried everything. I uninstalled anaconda, I tried pip install regex NOTHING works. I am desperate. I cannot work since days. Please help me.
Make sure regex version is up to date in requirements.txt. For me it works when I set regex==2022.3.2.
I tried to install mysql module with pip install mysql-python and I got this:
(env)nathann#esp2:/home/esp2$ sudo pip install mysql-python
Downloading/unpacking mysql-python
Downloading MySQL-python-1.2.5.zip (108Kb): 108Kb downloaded
Running setup.py egg_info for package mysql-python
Installing collected packages: mysql-python
Running setup.py install for mysql-python
building '_mysql' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/include/mysql -I/usr/include/python2.7 -c _mysql.c -o build/temp.linux-x86_64-2.7/_mysql.o -DBIG_JOINS=1 -fno-strict-aliasing -g
_mysql.c:29:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1
Complete output from command /usr/bin/python -c "import setuptools;__file__='/home/esp2/build/mysql-python/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-yuSaAG-record/install-record.txt:
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
copying _mysql_exceptions.py -> build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/__init__.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/converters.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/connections.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/cursors.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/release.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/times.py -> build/lib.linux-x86_64-2.7/MySQLdb
creating build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/__init__.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/REFRESH.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
running build_ext
building '_mysql' extension
creating build/temp.linux-x86_64-2.7
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/include/mysql -I/usr/include/python2.7 -c _mysql.c -o build/temp.linux-x86_64-2.7/_mysql.o -DBIG_JOINS=1 -fno-strict-aliasing -g
_mysql.c:29:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1
----------------------------------------
Command /usr/bin/python -c "import setuptools;__file__='/home/esp2/build/mysql-python/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-yuSaAG-record/install-record.txt failed with error code 1
Storing complete log in /home/nathann/.pip/pip.log
(env)nathann#esp2:/home/esp2$
You probably do not have the python development headers installed. On debian flavors:
sudo apt-get install python-dev
On other unix flavors, sometimes it's called python-devel
It was working like a charm before the update from Mountain Lion.
After the update it is broken and I cannot get the environment up again.
Does anybody know how to fix this?
The error is bolded, below.
fedorius#this:~$ pip install mysql-python
Downloading/unpacking mysql-python
Downloading MySQL-python-1.2.5.zip (108kB): 108kB downloaded
Running setup.py (path:/private/var/folders/21/zjvwzn891jnf4rnp526y13200000gn/T/pip_build_fedorius/mysql-python/setup.py) egg_info for package mysql-python
Installing collected packages: mysql-python
Running setup.py install for mysql-python
building '_mysql' extension
cc -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -pipe -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/local/mysql/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _mysql.c -o build/temp.macosx-10.9-intel-2.7/_mysql.o -Os -g -fno-strict-aliasing -arch x86_64
clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
error: command 'cc' failed with exit status 1
Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/var/folders/21/zjvwzn891jnf4rnp526y13200000gn/T/pip_build_fedorius/mysql-python/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/21/zjvwzn891jnf4rnp526y13200000gn/T/pip-_yi6sy-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.macosx-10.9-intel-2.7
copying _mysql_exceptions.py -> build/lib.macosx-10.9-intel-2.7
creating build/lib.macosx-10.9-intel-2.7/MySQLdb
copying MySQLdb/__init__.py -> build/lib.macosx-10.9-intel-2.7/MySQLdb
copying MySQLdb/converters.py -> build/lib.macosx-10.9-intel-2.7/MySQLdb
copying MySQLdb/connections.py -> build/lib.macosx-10.9-intel-2.7/MySQLdb
copying MySQLdb/cursors.py -> build/lib.macosx-10.9-intel-2.7/MySQLdb
copying MySQLdb/release.py -> build/lib.macosx-10.9-intel-2.7/MySQLdb
copying MySQLdb/times.py -> build/lib.macosx-10.9-intel-2.7/MySQLdb
creating build/lib.macosx-10.9-intel-2.7/MySQLdb/constants
copying MySQLdb/constants/__init__.py -> build/lib.macosx-10.9-intel-2.7/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.macosx-10.9-intel-2.7/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.macosx-10.9-intel-2.7/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.macosx-10.9-intel-2.7/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.macosx-10.9-intel-2.7/MySQLdb/constants
copying MySQLdb/constants/REFRESH.py -> build/lib.macosx-10.9-intel-2.7/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.macosx-10.9-intel-2.7/MySQLdb/constants
running build_ext
building '_mysql' extension
creating build/temp.macosx-10.9-intel-2.7
cc -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -pipe -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/local/mysql/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _mysql.c -o build/temp.macosx-10.9-intel-2.7/_mysql.o -Os -g -fno-strict-aliasing -arch x86_64
**clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
error: command 'cc' failed with exit status 1**
----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/var/folders/21/zjvwzn891jnf4rnp526y13200000gn/T/pip_build_fedorius/mysql-python/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/21/zjvwzn891jnf4rnp526y13200000gn/T/pip-_yi6sy-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/var/folders/21/zjvwzn891jnf4rnp526y13200000gn/T/pip_build_fedorius/mysql-python
Storing debug log for failure in /var/folders/21/zjvwzn891jnf4rnp526y13200000gn/T/tmp5QBn55
UPDATE:
As suggested, I've added
export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments
But it changed the error to
error: /Library/Python/2.7/site-packages/_mysql.so: Permission denied
I just chmoded this directory to allow writing and it worked :)
This is due to mixing macports, easy_install and pip... shame on me.
The problem is due to changes introduced in Xcode 5.1 and due to the way the Apple-supplied system Python 2.7 is built. Try adding these environment variable values before running pip:
export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments
See clang error: unknown argument: '-mno-fused-madd' (python package installation failure) for more information.
UPDATE [2014-05-16]: As expected, Apple has fixed this problem with updated system Pythons (2.7, 2.6, and 2.5) in OS X 10.9.3 so the workaround is no longer necessary when using the latest Mavericks and Xcode 5.1+. However, as of now, the workaround is still required for OS X 10.8.x (Mountain Lion, currently 10.8.5) if you are using Xcode 5.1+ there.
Building on Ned's answer:
Since I don't want to use sudo to install packages (I am using virtual environments) or affect my golbal environment, I added the two variables to the single execution of pip install:
CFLAGS=-Qunused-arguments CPPFLAGS=-Qunused-arguments pip install -r requirements.txt