[英]Having trouble using mingw to install python packages
我已经花了几个小时来搜索,但是还没有找到任何答案。 我正在尝试为Python 3.4安装软件包,但仍然遇到问题。 首先,我尝试仅运行“ python setup.py install”:
running install
running build
running build_py
running build_ext
error: Python was built with Visual Studio 2003;
extensions must be built with a compiler than can generate compatible binaries.
Visual Studio 2003 was not found on this system. If you have Cygwin installed,
you can try compiling with MingW32, by passing "-c mingw32" to setup.py.
经过长时间的搜索,我下载了mingw,将C:/ MinGW / bin添加到我的路径中,确保MinGW具有gcc,并使用[build]和编译器= mingw32制作了distutils.cfg文件。 在再次运行python setup.py安装时,出现了相同的错误。
我尝试了它的建议,将-c mingw32传递给setup.py。 它对于setup.py安装无法做到,所以我做了setup.py构建:
python setup.py build -c mingw32
running build
running build_py
running build_ext
一切似乎都很好,但是当我在构建后尝试安装时,它会尝试重新构建整个过程,因为由于某种原因我无法通过编译器,因此它失败了。
如何让setup.py工作? 如果有帮助,我正在尝试安装噪声包,并正在使用Windows Vista 64位(我没有多少钱...)。
我最近有类似的问题。
Windows构建的一些技巧:
where.exe python.exe
%PYTHONPATH%
和%PYTHONHOME%
python setup.py clean --all
--all
,则对于大多数用例而言,它是无用的。 (更像是撒粉。) setup.py
联机帮助。
setup.py
python setup.py --help
build
命令: python setup.py build --help
install
命令: python setup.py install --help
clean
命令: python setup.py clean --help
python setup.py clean --all
python setup.py build
(可选参数: -c mingw32
) python setup.py install --record files.txt
--record files.txt
帮助您在破坏某些内容时进行卸载。 Libs\\site-packages
以进行Python安装。 你看到包裹了吗? 通常,您可以看到*.pyd
文件,与DLL相似。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.