"Не удалось построить колесо для регулярных выражений" при установке пакета pip - PullRequest
0 голосов
/ 12 декабря 2018

У меня проблемы с установкой pip-пакета в Windows 10 WSL с Debian Stretch.

Во время работы sudo pip install invoice2data с установленным python3-pip возникают следующие ошибки.

error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

----------------------------------------
Failed building wheel for regex
Running setup.py clean for regex
Failed to build regex

x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-2.7.13=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c regex_2/_regex.c -o build/temp.linux-x86_64-2.7/regex_2/_regex.o
regex_2/_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


----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, okenize;__file__='/tmp/pip-install-D9zG6P/regex/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-0dvlsB/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-D9zG6P/regex/

1 Ответ

0 голосов
/ 12 декабря 2018

WSL не связан с проблемой, это довольно стандартная ошибка.

Убедитесь, что установлены следующие пакеты.Установите их, используя apt-get install packagename.Проблема в этот раз была решена установкой python-dev.

python3
python3-pip
ipython3
build-essential
python-dev
python3-dev
...