我尝试安装Python包dulwich:
pip install dulwich
但我收到了一条神秘的错误消息:
error: Unable to find vcvarsall.bat
如果我尝试手动安装软件包,也会发生同样的情况:
> python setup.py install
running build_ext
building 'dulwich._objects' extension
error: Unable to find vcvarsall.bat
我尝试安装Python包dulwich:
pip install dulwich
但我收到了一条神秘的错误消息:
error: Unable to find vcvarsall.bat
如果我尝试手动安装软件包,也会发生同样的情况:
> python setup.py install
running build_ext
building 'dulwich._objects' extension
error: Unable to find vcvarsall.bat
当前回答
Microsoft Visual C++编译器for Python 2.7位于http://www.microsoft.com/en-us/download/details.aspx?id=44266不是解决方案?
其他回答
我也遇到过同样的问题,所以我将在这里讲述我的故事,希望它能帮助其他人解决同样的问题并节省我刚刚花的几个小时:
我在一个windows7盒子里有mingw(g++(GCC)4.6.1)和python 2.7.3,我正在尝试安装PyCrypto。
在运行setup.py install时,这一切都以以下错误开始:
error: Unable to find vcvarsall.bat
通过将mingw指定为所选编译器,在谷歌搜索错误后轻松解决:
setup.py install build --compiler=mingw32
问题是,然后我得到了一个不同的错误:
configure: error: cannot run C compiled programs.
事实证明,我的防病毒软件阻止了新编译的.exe的执行。我刚刚禁用了防病毒“常驻屏蔽”,并转到下一个错误:
cc1.exe: error: unrecognized command line option '-mno-cygwin'
error: command 'gcc' failed with exit status 1
这解决了这个问题:“要么安装稍微旧一点的MinGW版本,要么在Python目录中编辑distutils\cygwinccompiler.py以删除-mno-cygwin的所有实例。”(从这里开始)
现在,我终于可以开始工作了。
对于Python 3.4,依赖于Visual Studio 2010。安装Visual C++2010 Express为我解决了这个问题。
欺骗它使用VS 2008或2013安装,而我碰巧没有使用。
我遵守了指示http://springflex.blogspot.ru/2014/02/how-to-fix-valueerror-when-trying-to.html.但什么都没发生。然后我安装了2010 Visual Studio Express(http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-cpp-express)遵循建议http://blog.python.org/2012/05/recent-windows-changes-in-python-33.html它帮助了我
我尝试了以上所有的答案,但没有为我工作。我使用的是Windows 10,并安装了Visual Studio 2010在我的情况下,需要将vcvars64.bat添加到C:\Program Files(x86)\Microsoft Visual Studio 10.0\VC\bin\amd64
下面是vcvars64.bat:
CALL "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64
如果未安装,请安装Microsoft SDK 7.1,然后重新运行pip Install dulwich
http://www.stickpeople.com/projects/python/win-psycopg/
从上面的链接安装适当的文件修复了我的问题。
提及:Jason Erickson[jerickso@stickpeople.com]. 他为Windows用户管理这个页面相当好。