I am trying the following command on Windows 7 using powershell
我正在使用PowerShell在Windows 7上尝试以下命令
pip install psycopg2
And i am getting an error:
我收到一个错误:
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
错误:需要Microsoft Visual C ++ 14.0(无法找到vcvarsall.bat)。命令“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-external-managed --compile”failed with error code 1在C:\ Users \ Piyush \ AppData \ Local \ Temp \ pip-build-qe38dwoj \ psycopg2
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??
要安装Visuall C ++,它需要安装Visual Studio。除了安装Visual Studio 2013.还有其他的,我可以为Python 3.5安装Psycopg2吗?
3 个解决方案
#1
8
I ran into a similar issue on Windows. I had to install a compiled version of it and then easy_install it.
我在Windows上遇到了类似的问题。我必须安装它的编译版本然后easy_install它。
You can find a compiled version of psycopg2 here: http://www.lfd.uci.edu/~gohlke/pythonlibs/
你可以在这里找到psycopg2的编译版本:http://www.lfd.uci.edu/~gohlke/pythonlibs/
And then do easy_install C:/locaiton/of/download.exe
然后做easy_install C:/locaiton/of/download.exe
That's what I do to install it on my Windows machine.
这就是我在Windows机器上安装它的方法。
#2
11
Try this one. It worked for me
试试这个。它对我有用
I Visited the http://www.lfd.uci.edu/~gohlke/pythonlibs/ and downloaded psycopg2-2.6.1-cp35-none-win32.whl file and copied it on C:\
我访问了http://www.lfd.uci.edu/~gohlke/pythonlibs/并下载了psycopg2-2.6.1-cp35-none-win32.whl文件并将其复制到C:\
later I activated my Virualenv by running this C:\mydjango\django19\Scripts\activate on the cmd which resulted to this (django19) C:/> and ran the following pip command, pip install psycopg2-2.6.1-cp35-none-win32.whl and the installation was successful.
后来我通过在cmd上运行这个C:\ mydjango \ django19 \ Scripts \ activate来激活我的Virualenv,这导致了这个(django19)C:/>并运行了以下pip命令,pip install psycopg2-2.6.1-cp35-none -win32.whl并且安装成功。
Note: Run the pip install psycopg2.......whl when you are in the current folder that has the psycopg2-2.6.1-cp35-none-win32.whl file via cmd
注意:当您在当前具有psycopg2-2.6.1-cp35-none-win32.whl文件的文件夹中通过cmd运行pip install psycopg2 ....... whl
#3
1
For Linux/Mac based you need to first install:
对于基于Linux / Mac的,您需要先安装:
sudo apt-get install python3-dev
and then install psycopg2:
然后安装psycopg2:
pip install psycopg2
For me it worked in DigitalOcean Linux 16.04 Production server
对我来说,它适用于DigitalOcean Linux 16.04 Production服务器
Let me know if anyone got this correct!
如果有人认为这是正确的,请告诉我!
#1
8
I ran into a similar issue on Windows. I had to install a compiled version of it and then easy_install it.
我在Windows上遇到了类似的问题。我必须安装它的编译版本然后easy_install它。
You can find a compiled version of psycopg2 here: http://www.lfd.uci.edu/~gohlke/pythonlibs/
你可以在这里找到psycopg2的编译版本:http://www.lfd.uci.edu/~gohlke/pythonlibs/
And then do easy_install C:/locaiton/of/download.exe
然后做easy_install C:/locaiton/of/download.exe
That's what I do to install it on my Windows machine.
这就是我在Windows机器上安装它的方法。
#2
11
Try this one. It worked for me
试试这个。它对我有用
I Visited the http://www.lfd.uci.edu/~gohlke/pythonlibs/ and downloaded psycopg2-2.6.1-cp35-none-win32.whl file and copied it on C:\
我访问了http://www.lfd.uci.edu/~gohlke/pythonlibs/并下载了psycopg2-2.6.1-cp35-none-win32.whl文件并将其复制到C:\
later I activated my Virualenv by running this C:\mydjango\django19\Scripts\activate on the cmd which resulted to this (django19) C:/> and ran the following pip command, pip install psycopg2-2.6.1-cp35-none-win32.whl and the installation was successful.
后来我通过在cmd上运行这个C:\ mydjango \ django19 \ Scripts \ activate来激活我的Virualenv,这导致了这个(django19)C:/>并运行了以下pip命令,pip install psycopg2-2.6.1-cp35-none -win32.whl并且安装成功。
Note: Run the pip install psycopg2.......whl when you are in the current folder that has the psycopg2-2.6.1-cp35-none-win32.whl file via cmd
注意:当您在当前具有psycopg2-2.6.1-cp35-none-win32.whl文件的文件夹中通过cmd运行pip install psycopg2 ....... whl
#3
1
For Linux/Mac based you need to first install:
对于基于Linux / Mac的,您需要先安装:
sudo apt-get install python3-dev
and then install psycopg2:
然后安装psycopg2:
pip install psycopg2
For me it worked in DigitalOcean Linux 16.04 Production server
对我来说,它适用于DigitalOcean Linux 16.04 Production服务器
Let me know if anyone got this correct!
如果有人认为这是正确的,请告诉我!