安装census python模块时出错:visual studio 9.0未编译水母
我正在运行一台带有Python 2.7的64位Windows 7计算机,并试图安装找到的census Python模块(版本0.7)。我已经安装了Visual Studio Express 2008(版本9.0)以及版本8、11和12。当我尝试安装该模块时,它退出并出现致命错误 当我运行命令提示符安装census python模块时出错:visual studio 9.0未编译水母,python,windows,visual-studio,python-2.7,census,Python,Windows,Visual Studio,Python 2.7,Census,我正在运行一台带有Python 2.7的64位Windows 7计算机,并试图安装找到的census Python模块(版本0.7)。我已经安装了Visual Studio Express 2008(版本9.0)以及版本8、11和12。当我尝试安装该模块时,它退出并出现致命错误 当我运行命令提示符pip install-U census时,以下是我在错误发生前得到的最后几行: creating build\temp.win-amd64-2.7\Release C:\Program
pip install-U census
时,以下是我在错误发生前得到的最后几行:
creating build\temp.win-amd64-2.7\Release
C:\Programfiles (x86)\Microsoft Visual Studio 9.0\VC\BIN\amd64\cl.exe /c
/nologo /0x /MD /W3 /GS- /DNDEBUG -IC:\Users\user\Anaconda\include -IC:\User
s\user\Anaconda\PC /Tcjellyfishmodule.c /Fobuild\temp.wim-amd64-2.7\Release\
jellyfishmodule.obj
jellyfishmodule.c
c: \users\user\appdata\local\temp\pip-build-orcdrr\jellyfish\jellyfish.h
(4) : fatal error C1083: Cannot open include file: 'stdbool.h': No such file
or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\VC
\\BIN\\amd64\\cl.exe' failed with exit status 2
当我在census-0.7目录中并输入提示符python setup.py install
我试过这个方法,但不起作用。当我在census-0.7目录中并输入提示符python setup.py build--compiler msvc
,正如修复程序所建议的,我会收到以下错误消息:
running build
running build_py
file census.py (for module census) not found
file census.py (for module census) not found
这让我相信人口普查模块的源代码可能有问题。是否有人有在64位机器上用Python 2.7解决此错误的经验,或者有安装普查模块的经验?我是一个比较新手的程序员,所以如果有一个简单或明显的修复方法,我可能看不到。VC14有更多C99支持,包括
\u Bool
类型和stdbool.h,但我还没有尝试使用它来构建2.7扩展模块。您也可以使用MinGW(gcc完全支持C99)。您可以通过定义自己的stdbool.h
来解决这个问题。请参阅问题@eryksun Installed MinGW并发现相同的错误消息。@martineau我应该在哪里定义stdbool.h?只需将它放在引用它的源文件所在的文件夹中,就可以了。否则,请将其放在Visual Studio保留自己的位置。VC 14具有更多C99支持,包括\u Bool
类型和stdbool.h,但我还没有尝试使用它构建2.7扩展模块。您也可以使用MinGW(gcc完全支持C99)。您可以通过定义自己的stdbool.h
来解决这个问题。请参阅问题@eryksun Installed MinGW并发现相同的错误消息。@martineau我应该在哪里定义stdbool.h?只需将它放在引用它的源文件所在的文件夹中,就可以了。否则,请将其放在VisualStudio自己的位置。