如何安装Psycopg2 for Python 3.5 [英] How to install Psycopg2 for Python 3.5

查看:279
本文介绍了如何安装Psycopg2 for Python 3.5的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Windows 7上使用powershell尝试以下命令

I am trying the following command on Windows 7 using powershell

pip install psycopg2

我收到错误:


错误:Microsoft Visual C ++ 14.0是必需的(无法找到vcvarsall.bat)。
命令C:\Users\Piyush\AppData\Local\Programs\Python\Python35\python.exe -cimport setuptools,tokenize; 文件 ='C:\Users\Piyush\AppData\Local\Temp\pip-build-qe38dwoj\psycopg2\setup.py'; exec(compile(getattr(tokenize,'open',open) (文件)。read()。replace('\r\\\
','\\\
'),文件,'exec'))install - -record C:\Users\Piyush\AppData\Local\Temp\pip-7bjug79j-record\install-record.txt - 单一版本 - 外部管理 - 编译失败并显示错误代码1在C:\Users\Piyush\AppData\Local\Temp\pip-build-qe38dwoj\psycopg2

error: Microsoft Visual C++ 14.0 is required (Unable to find vcvarsall.bat). Command "C:\Users\Piyush\AppData\Local\Programs\Python\Python35\python.exe -c "import setuptools, tokenize;file='C:\Users\Piyush\AppData\Local\Temp\pip-build-qe38dwoj\psycopg2\setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record C:\Users\Piyush\AppData\Local\Temp\pip-7bjug79j-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Piyush\AppData\Local\Temp\pip-build-qe38dwoj\psycopg2

为了安装Visuall C ++,它需要安装Visual Studio。
除了安装Visual Studio 2013
有没有其他的,我可以安装Psycopg2 for Python 3.5 ??

To intall Visuall C++, it requires Visual Studio to be installed. Except for installing Visual Studio 2013. Is there any other, that I can install Psycopg2 for Python 3.5??

推荐答案

在Windows上遇到类似的问题。我不得不安装它的编译版本,然后easy_install它。

I ran into a similar issue on Windows. I had to install a compiled version of it and then easy_install it.

你可以在这里找到一个编译版本的psycopg2: http://www.lfd.uci.edu/~gohlke/pythonlibs/

You can find a compiled version of psycopg2 here: http://www.lfd.uci.edu/~gohlke/pythonlibs/

然后做easy_install C:/locaiton/of/download.exe

And then do easy_install C:/locaiton/of/download.exe

这是我在Windows机器上安装它。

That's what I do to install it on my Windows machine.

这篇关于如何安装Psycopg2 for Python 3.5的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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