【问题标题】:cygwin 64 bit - can't install Pillow via pipcygwin 64 位 - 无法通过 pip 安装 Pillow
【发布时间】:2015-04-21 03:48:42
【问题描述】:

无论我安装哪个 gcc 编译器,我似乎都无法在 cygwin 64 位上安装 pip。我已经尝试了所有在搜索 g++ 时出现的方法

有人知道我应该使用哪一个吗?或者如果我的做法完全错误?

在构建 pip 时出现如下错误:

gcc -fno-strict-aliasing -ggdb -O2 -pipe -Wimplicit-function-declaration -fdebug-prefix-map=/usr/src/ports/python/python-2.7.8-1.x86_64/build=/usr/src/debug/python-2.7.8-1 -fdebug-prefix-map=/usr/src/ports/python/python-2.7.8-1.x86_64/src/Python-2.7.8=/usr/src/debug/python-2.7.8-1 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DHAVE_LIBZ -I/usr/include/freetype2 -I/tmp/pip-build-AceIfG/Pillow/libImaging -I/c/Users/guy/Envs/hippo_dev/include -I/usr/include -I/usr/include/python2.7 -c libImaging/ConvertYCbCr.c -o build/temp.cygwin-1.7.35-x86_64-2.7/libImaging/ConvertYCbCr.o
In file included from /c/Users/guy/Envs/hippo_dev/include/Python.h:58:0,
                 from outline.c:20:
/c/Users/guy/Envs/hippo_dev/include/pyport.h:886:2: error: #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
 #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
  ^
In file included from /c/Users/guy/Envs/hippo_dev/include/Python.h:58:0,
                 from libImaging/ImPlatform.h:10,
                 from libImaging/Imaging.h:14,
                 from libImaging/ConvertYCbCr.c:15:
/c/Users/guy/Envs/hippo_dev/include/pyport.h:886:2: error: #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
 #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
  ^
In file included from /c/Users/guy/Envs/hippo_dev/include/Python.h:58:0,
                 from libImaging/ImPlatform.h:10,
                 from libImaging/Imaging.h:14,
                 from libImaging/Bands.c:19:
/c/Users/guy/Envs/hippo_dev/include/pyport.h:886:2: error: #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
 #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
  ^
In file included from /c/Users/guy/Envs/hippo_dev/include/Python.h:58:0,
                 from _imaging.c:76:
/c/Users/guy/Envs/hippo_dev/include/pyport.h:886:2: error: #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
 #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
  ^

【问题讨论】:

  • 作为参考,这在 cygwin 32 位上不会发生。它在那里安装得很好。

标签: python gcc cygwin pip pillow


【解决方案1】:

你写你安装并尝试了多个编译器。如果您的意思是来自 setup.exe 的编译器,那么“gcc”是 Cygwin 编译器,其位数与安装它的 Cygwin 相同(即 cygwin32 上的 cygwin32 编译器和 cygwin64 上的 cygwin64 编译器)。其他编译器有不同的名称,例如 x86_64-w64-mingw32-gcc 或 x86_64-pc-cygwin-gcc。

问题可能在于——如果你想使用 Cygwin 编译器进行编译——你应该使用来自 Cygwin Python 的 Python 头文件。看起来/c/Users/guy/Envs/hippo_dev/include/ 包含来自某些 32 位 Python 的 Python 标头。一般来说,除非您确定它们兼容,否则不应混入任何非 Cygwin 提供的头文件或库。

【讨论】:

  • 感谢您在#cygwin 上回复我。我只使用了 cygwin setup.exe 安装程序中的软件包,所以它们都必须是 cygwin?如果我使用的是 64 位版本的 cygwin,它会自动安装 64 位版本的 python 和相关的 python 头库吗?我没有注意到任何 64 位特定的 python 头文件或开发包。
  • 是的,setup.exe 安装的所有内容都与已安装的 Cygwin 本身具有相同的位数(如果适用),因此 64 位 Cygwin 上的 python 包安装 64 位 Python(标题也是如此) .请参阅gist.github.com/elieux/b11c3a5f7bd476f5068e 了解我的 Python 标头的 32 位和 64 位版本之间的区别。
猜你喜欢
  • 2016-10-20
  • 1970-01-01
  • 2016-05-18
  • 2021-04-21
  • 2017-02-08
  • 2019-06-18
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多