Python:无法轻松安装 (Windows 7 x64)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5504404/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 16:31:56  来源:igfitidea点击:

Python: Unable to easy_install (Windows 7 x64)

pythonwindowsdistutilswindows-7-x64pysqlite

提问by Dirk

I'm running python 2.7 on Windows 7 x64, and trying to easy_install pysqlite.

我在 Windows 7 x64 上运行 python 2.7,并尝试 easy_install pysqlite。

With command: easy_install -U pysqlite

使用命令: easy_install -U pysqlite

It exits with the error:

它退出并出现错误:

error: Setup script exited with error: Unable to find vcvarsall.bat

错误:安装脚本退出并出现错误:无法找到 vcvarsall.bat

This site: http://code.google.com/p/rdflib/issues/detail?id=104#c4suggests a workaround of installing MingGW, saying to check the g++ option on install (plus some other stuff).

这个站点:http: //code.google.com/p/rdflib/issues/detail?id=104#c4 建议了一种安装 MingGW 的解决方法,说要检查安装时的 g++ 选项(以及其他一些东西)。

Unfortunately, MingGW does not give me the option to install g++, only c++, and of course on running easy_install a second time, I get ".. command 'gcc' failed: No such file or directory". So now I am el stucko.

不幸的是,MingGW 没有给我安装 g++ 的选项,只有 c++,当然在第二次运行 easy_install 时,我得到“.. 命令 'gcc' 失败:没有这样的文件或目录”。所以现在我是 el sticko。

Any advice on how to fix this problem would be great!

关于如何解决这个问题的任何建议都会很棒!

回答by Sridhar Ratnakumar

Even if you install a compiler (MinGW or Visual Studio), you still have to install SQLite3 development libraries. It is a pain to build things on Windows, so I suggest that you get the unofficial pre-built Windows binariesand install it.

即使你安装了编译器(MinGW 或 Visual Studio),你仍然需要安装 SQLite3 开发库。在 Windows 上构建东西很痛苦,所以我建议你获取非官方的预构建的 Windows 二进制文件并安装它。

As an aside, you should probably consider switching to ActivePythonas it includes a package manager that allows you to install pre-built modules from ActiveState's repository.

顺便说一句,您可能应该考虑切换到 ActivePython,因为它包含一个包管理器,允许您从ActiveState 的存储库安装预先构建的模块。

As for the particular error in question, that is a distutils bug and you should raise your concerns in the Python bug tracker.

至于有问题的特定错误,这是一个 distutils 错误,您应该在Python 错误跟踪器中提出您的担忧。

回答by jhocking

When that says "g++ compiler" they really mean the C++ compiler, which for mingw is gcc.

当说“g++ 编译器”时,它们实际上是指 C++ 编译器,对于 mingw 来说是 gcc。

回答by Jakob Bowyer

You need to install the Microsoft Visual C compiler thingy (the 2010 one). And use that as your compiler for all modules. You can also mess with distuls.cfg and specify a compiler that way.

您需要安装 Microsoft Visual C 编译器(2010 版)。并将其用作所有模块的编译器。您还可以使用 distuls.cfg 并以这种方式指定编译器。