2015-01-31 19 views
1

我下面Heroku的關於如何使用Python建立一個web項目和Django的Windows和一直無法弄清楚我LNK2001錯誤psycopg2說明。Windows 7中的Heroku Python的Django的LNK2001錯誤psycopg2

教程鏈接:

我運行這個命令:

$ pip install -r requirements.txt --allow-all-external 

她e是誤差輸出:

Creating library build\temp.win32-2.7\Release\psycopg\_psycopg.lib and object build\temp.win32-2.7\Release\psycopg\_psycopg.exp 

pqpath.obj : error LNK2019: unresolved external symbol _PQclear referenced in function _pq_raise 

connection_int.obj : error LNK2001: unresolved external symbol _PQclear 

cursor_type.obj : error LNK2001: unresolved external symbol _PQclear 

... 

    build\lib.win32-2.7\psycopg2\_psycopg.pyd : fatal error LNK1120: 62 unresolved externals 

error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\VC\\BIN\\link.exe' failed with exit status 1120 

---------------------------------------- 
←[31m Command "C:\Python27\python.exe -c "import setuptools, tokenize;__file__='c:\\users\\mariss~1.nie\\appdata\\local\\temp\\pip-build-vojshb\\p 
ycopg2\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\ 
ariss~1.nie\appdata\local\temp\pip-nuj6xa-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in c:\use 
s\mariss~1.nie\appdata\local\temp\pip-build-vojshb\psycopg2←[0m 

我使用以下:

  • 視窗7 64位
  • 的Python 2.7.8 32位
  • 虛擬環境(的virtualenv)
  • 的PostgreSQL 9.4
  • 微軟的Visual Studio 2012 32-b它

我已經把C:\Program Files\PostgreSQL\9.4\bin;C:\Python27\;C:\Python27\Scripts\放在我的PATH變量中。

想法?

回答

0

就我而言,我改變了安裝在32位的Postgres,我已經過了這個錯誤。

我小心安裝了64位安裝的Postgres 9.4.1。之後,發佈了編譯和鏈接此錯誤的任何嘗試。試圖將編譯器更改爲mingv32,我注意到他在庫libpg.dll(未知格式)中出現錯誤。然後,我在根目錄(c:/ postgreSQL)中卸載並安裝了postgres 32位版本9.4的系統。問題已經通過。

在我的情況下,配置有相同的,但我安裝一個額外的微軟的Visual C++快遞10版本。

配置:

  • 視窗7(64位)
  • 的Python 3.4
  • 的Postgres 9.4.1(重新安裝) - >的Postgres 9.4 MS
  • 的Visual C++速成10版本
  • PIP
  • VIRTUALENV
0

創建一個Linux VM,並隨後再次在該環境中的步驟。工作很好。不知道爲什麼我無法在Windows中工作。