安装pip套件时出现“ regex的建筑轮子失败”

时间:2018-12-12 13:58:12

标签: python pip debian-stretch

我在运行Debian Stretch的Windows 10 WSL上安装pip软件包时遇到问题。

运行MyVt myVar {0}; static_assert( isTypeInList_v<int, decltype(myVar)> ); 并安装sudo pip install invoice2data时,我遇到以下错误。

python3-pip

5 个答案:

答案 0 :(得分:3)

WSL与该问题无关,这是一个相当标准的错误。

确保已安装以下软件包。使用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/ 安装它们。通过安装apt-get install packagename解决了这个特定时间的问题。

python-dev

答案 1 :(得分:0)

重新启动bash。我遇到了同样的错误,但是重启帮助了

答案 2 :(得分:0)

运行pip3 install pyinquirer时出现类似的错误

ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-a7ojseph/regex/setup.py'"'"'; __file__='"'"'/tmp/pip-install-a7ojseph/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-bodowot9/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.7/regex Check the logs for full command output.

对我来说,安装python3-dev无效,因为我已经安装了它。但是,安装build-essential可以解决问题,并且正则表达式模块已成功安装。

答案 3 :(得分:0)

我正在Ubuntu上运行Python 3.5。我如何安装 private static void printBowtie(int n) { - for (int i = 0; i < n + 1; i++) { + for (int i = 0; i < n; i++) { for (int j = 0; j < n + 1; j++) { - if ((j > i && j < n - i) || (j > (n - i) && j < i && i > n)) { + if ((j > i && j < n - i) || (j >= n - i && j <= i)) { Python软件包是:

regex

背景研究详细信息:

我通过使用$ sudo apt-get install libpython3.5-dev $ pip3 install regex --no-use-wheel 来找到提供丢失的Python.h文件的程序包名称。

apt-file

然后就我需要哪个软件包做出了有根据的猜测。忽略Python2,忽略调试(dbg),忽略pypy,从而保留libpython3.5-dev。

答案 4 :(得分:0)

apk add build-base --no-cache

https://wiki.alpinelinux.org/wiki/GCC