I am trying to install Psycopg2 in my VirtualEnv, initially i was facing error it could not find pg_config.exe and i solved it by adding complete path in PATH.
But then it gave error Microsoft Visual C++ 14.0 is required. To remove this i have Installed VC_redist.x64 VC_redist.x86.
I have also installed C++ development modules in VS community. but it still gives this Error.
EDIT: Have also downloaded and installed VS build tools .
My Environment: Windows 10 SL, Python 3.8.0, VirtualEnv 16.7.7, pip 19.3.1
psycopgmodule.obj : error LNK2001: unresolved external symbol _PQfreemem
psycopgmodule.obj : error LNK2001: unresolved external symbol _PQencryptPasswordConn
psycopgmodule.obj : error LNK2001: unresolved external symbol _PQencryptPassword
psycopgmodule.obj : error LNK2001: unresolved external symbol _PQinitOpenSSL
psycopgmodule.obj : error LNK2001: unresolved external symbol _PQconninfoParse
psycopgmodule.obj : error LNK2001: unresolved external symbol _PQerrorMessage
psycopgmodule.obj : error LNK2001: unresolved external symbol _PQlibVersion
psycopgmodule.obj : error LNK2001: unresolved external symbol _PQconninfoFree
green.obj : error LNK2001: unresolved external symbol _PQclear
pqpath.obj : error LNK2001: unresolved external symbol _PQbinaryTuples
pqpath.obj : error LNK2001: unresolved external symbol _PQsetnonblocking
pqpath.obj : error LNK2001: unresolved external symbol _PQgetvalue
pqpath.obj : error LNK2001: unresolved external symbol _PQresultStatus
pqpath.obj : error LNK2001: unresolved external symbol _PQoidValue
pqpath.obj : error LNK2001: unresolved external symbol _PQcmdStatus
pqpath.obj : error LNK2001: unresolved external symbol _PQsocket
pqpath.obj : error LNK2001: unresolved external symbol _PQftablecol
pqpath.obj : error LNK2001: unresolved external symbol _PQputCopyData
pqpath.obj : error LNK2001: unresolved external symbol _PQstatus
pqpath.obj : error LNK2001: unresolved external symbol _PQisBusy
pqpath.obj : error LNK2001: unresolved external symbol _PQconsumeInput
pqpath.obj : error LNK2001: unresolved external symbol _PQresultErrorField
pqpath.obj : error LNK2001: unresolved external symbol _PQfsize
pqpath.obj : error LNK2001: unresolved external symbol _PQfname
pqpath.obj : error LNK2001: unresolved external symbol _PQsendQuery
pqpath.obj : error LNK2001: unresolved external symbol _PQgetCopyData
pqpath.obj : error LNK2001: unresolved external symbol _PQftable
pqpath.obj : error LNK2001: unresolved external symbol _PQflush
pqpath.obj : error LNK2001: unresolved external symbol _PQftype
pqpath.obj : error LNK2001: unresolved external symbol _PQnfields
pqpath.obj : error LNK2001: unresolved external symbol _PQresultErrorMessage
pqpath.obj : error LNK2001: unresolved external symbol _PQexec
pqpath.obj : error LNK2001: unresolved external symbol _PQfmod
pqpath.obj : error LNK2001: unresolved external symbol _PQcmdTuples
pqpath.obj : error LNK2001: unresolved external symbol _PQntuples
pqpath.obj : error LNK2001: unresolved external symbol _PQresStatus
pqpath.obj : error LNK2001: unresolved external symbol _PQputCopyEnd
pqpath.obj : error LNK2001: unresolved external symbol _PQgetResult
utils.obj : error LNK2001: unresolved external symbol _PQescapeString
utils.obj : error LNK2001: unresolved external symbol _PQescapeStringConn
utils.obj : error LNK2001: unresolved external symbol _PQescapeIdentifier
connection_int.obj : error LNK2001: unresolved external symbol _PQconnectPoll
connection_int.obj : error LNK2001: unresolved external symbol _PQserverVersion
connection_int.obj : error LNK2001: unresolved external symbol _PQnotifies
connection_int.obj : error LNK2001: unresolved external symbol _PQsetNoticeProcessor
connection_int.obj : error LNK2001: unresolved external symbol _PQgetCancel
connection_int.obj : error LNK2001: unresolved external symbol _PQfinish
connection_int.obj : error LNK2001: unresolved external symbol _PQprotocolVersion
connection_int.obj : error LNK2001: unresolved external symbol _PQfreeCancel
connection_int.obj : error LNK2001: unresolved external symbol _PQconnectdb
connection_int.obj : error LNK2001: unresolved external symbol _PQconnectStart
connection_int.obj : error LNK2001: unresolved external symbol _PQparameterStatus
connection_type.obj : error LNK2001: unresolved external symbol _PQcancel
connection_type.obj : error LNK2001: unresolved external symbol _PQtransactionStatus
connection_type.obj : error LNK2001: unresolved external symbol _PQbackendPID
connection_type.obj : error LNK2001: unresolved external symbol _PQconninfo
cursor_type.obj : error LNK2001: unresolved external symbol _PQgetisnull
cursor_type.obj : error LNK2001: unresolved external symbol _PQgetlength
conninfo_type.obj : error LNK2001: unresolved external symbol _PQsslInUse
conninfo_type.obj : error LNK2001: unresolved external symbol _PQconnectionNeedsPassword
conninfo_type.obj : error LNK2001: unresolved external symbol _PQpass
conninfo_type.obj : error LNK2001: unresolved external symbol _PQdb
conninfo_type.obj : error LNK2001: unresolved external symbol _PQsslAttribute
conninfo_type.obj : error LNK2001: unresolved external symbol _PQport
conninfo_type.obj : error LNK2001: unresolved external symbol _PQoptions
conninfo_type.obj : error LNK2001: unresolved external symbol _PQconnectionUsedPassword
conninfo_type.obj : error LNK2001: unresolved external symbol _PQsslAttributeNames
conninfo_type.obj : error LNK2001: unresolved external symbol _PQuser
conninfo_type.obj : error LNK2001: unresolved external symbol _PQhost
lobject_int.obj : error LNK2001: unresolved external symbol _lo_truncate
lobject_int.obj : error LNK2001: unresolved external symbol _lo_write
lobject_int.obj : error LNK2001: unresolved external symbol _lo_export
lobject_int.obj : error LNK2001: unresolved external symbol _lo_import
lobject_int.obj : error LNK2001: unresolved external symbol _lo_creat
lobject_int.obj : error LNK2001: unresolved external symbol _lo_read
lobject_int.obj : error LNK2001: unresolved external symbol _lo_tell
lobject_int.obj : error LNK2001: unresolved external symbol _lo_create
lobject_int.obj : error LNK2001: unresolved external symbol _lo_lseek
lobject_int.obj : error LNK2001: unresolved external symbol _lo_unlink
lobject_int.obj : error LNK2001: unresolved external symbol _lo_open
lobject_int.obj : error LNK2001: unresolved external symbol _lo_close
adapter_binary.obj : error LNK2001: unresolved external symbol _PQescapeByteaConn
adapter_binary.obj : error LNK2001: unresolved external symbol _PQescapeBytea
build\lib.win32-3.8\psycopg2\_psycopg.cp38-win32.pyd : fatal error LNK1120: 83 unresolved externals
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.23.28105\\bin\\HostX86\\x86\\link.exe' failed with exit status 1120
background: I am doing development in Django which uses pgSQL, for some reasons, i did a clean install of windows and after windows installation, i run my virtualenv but it could not detect any package(maybe because my env was created in python 3.7 and now i had python 3.8(although i did try to install it with python 3.7)). So i had to rebuild the virtualenv and am currently stuck on psycopg2
Install python 64bit version (x86-64 on the official site). I'd had the same problem and did evrt what you did and it didn't work, after installing the proper version of python, i solved the issue.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.