I have a little problem (or a big one?). I want to install regex package
for Python 3.4. But then I use pip or our installation methods I am getting error:
universe@universe-AOD270:~/Downloads/regex-2016.04.25$ python setup.py install --user 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 -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/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 compilation terminated.**** error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
I think that this problem arise because installer try to install this package into Python2.7 directory, but I am not sure. I try pip installation, launch from interpreter of Python, running through terminal, but have no success.
Please, help me to solve this problem. Thanks in advance.
Best Answer
I also struggle with this error, then I found the python3-dev is missing but when I run the command it's already installed. Then I check for which python version it is installed using below command -
and output is like -
So then I check the version of python I am running to install that package using below command
Output -
So to install python3-dev use below command
Just replace it with your python3 or python2 version