如何在 Windows 7 上轻松安装 psycopg2? [英] How to easy_install psycopg2 on windows 7?

查看:63
本文介绍了如何在 Windows 7 上轻松安装 psycopg2?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在遵循教程的同时设置 osqa.我进入了引导你运行的线路:

While following this tutorial to setup osqa. I got into the line direct you to run:

easy_install.exe psycopg2

我在 C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC 下找到了 vcvarsall.bat 并将它的完整路径添加到 %PATH% 但仍然出现以下错误:

I had located vcvarsall.bat under C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC and added the full path of it to %PATH% but still get the following error:

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

这是完整的 cmd 输出:

Here is the full cmd output:

C:\>easy_install.exe psycopg2
Searching for psycopg2
Reading https://pypi.python.org/simple/psycopg2/
Reading http://initd.org/projects/psycopg2
Best match: psycopg2 2.5.3
Downloading https://pypi.python.org/packages/source/p/psycopg2/psycopg2-2.5.3.ta
r.gz#md5=09dcec70f623a9ef774f1aef75690995
Processing psycopg2-2.5.3.tar.gz
Writing c:\users\root\appdata\local\temp\easy_install-d3odyl\psycopg2-2.5.3\se
tup.cfg
Running psycopg2-2.5.3\setup.py -q bdist_egg --dist-dir c:\users\root\appdata\
local\temp\easy_install-d3odyl\psycopg2-2.5.3\egg-dist-tmp-lmlmsb
error: Setup script exited with error: Unable to find vcvarsall.bat

easy_install 尝试在哪里找到 vcvarsall.bat ?

Where easy_install try to find the vcvarsall.bat ?

推荐答案

为自己省点心,从 本网站,您可以在其中找到许多适用于 Windows 的 Python 库的编译安装程序.如果您在 Windows 上使用 Python,我强烈建议您将此添加为书签.

Save yourself some grief and download it from this website where you'll find compiled installers for many Python libraries for Windows. I highly recommend bookmarking this if you are using Python on Windows.

确保为您使用的 Python 版本下载正确的版本.这些安装程序与官方 Python 安装程序(来自 python.org)一起使用,因为它们读取安装程序位置的注册表值并完成其余的工作.

Make sure you download the correct one for the version of Python you are using. These installers work with the official Python installer (from python.org), as they read the registry value for the installer location and do the rest of the magic.

由于这些是 Windows 安装程序包,只需双击并按照提示操作即可.

As these are Windows installer packages, just double click and follow the prompts.

这篇关于如何在 Windows 7 上轻松安装 psycopg2?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆