简体   繁体   中英

I am trying to install psycopg2 in windows and getting error

I am firing following command and it's showing the same for psycopg2-binary

(demo) C:\Users\Lenovo\Desktop\Django>pip install psycopg2
Collecting psycopg2
  Using cached psycopg2-2.8.6.tar.gz (383 kB)
    ERROR: Command errored out with exit status 1:
     command: 'c:\users\lenovo\desktop\django\demo\scripts\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Lenovo\\AppData\\Local\\Temp\\pip-install-pq1_j08j\\psycopg2\\setup.py'"'"'; __file__='"'"'C:\\Users\\Lenovo\\AppData\\Local\\Temp\\pip-install-pq1_j08j\\psycopg2\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\Lenovo\AppData\Local\Temp\pip-pip-egg-info-a33qt0v5'
         cwd: C:\Users\Lenovo\AppData\Local\Temp\pip-install-pq1_j08j\psycopg2\
    Complete output (23 lines):
    running egg_info
    creating C:\Users\Lenovo\AppData\Local\Temp\pip-pip-egg-info-a33qt0v5\psycopg2.egg-info
    writing C:\Users\Lenovo\AppData\Local\Temp\pip-pip-egg-info-a33qt0v5\psycopg2.egg-info\PKG-INFO
    writing dependency_links to C:\Users\Lenovo\AppData\Local\Temp\pip-pip-egg-info-a33qt0v5\psycopg2.egg-info\dependency_links.txt
    writing top-level names to C:\Users\Lenovo\AppData\Local\Temp\pip-pip-egg-info-a33qt0v5\psycopg2.egg-info\top_level.txt
    writing manifest file 'C:\Users\Lenovo\AppData\Local\Temp\pip-pip-egg-info-a33qt0v5\psycopg2.egg-info\SOURCES.txt'

    Error: pg_config executable not found.

    pg_config is required to build psycopg2 from source.  Please add the directory
    containing pg_config to the $PATH or specify the full executable path with the
    option:

        python setup.py build_ext --pg-config /path/to/pg_config build ...

    or with the pg_config option in 'setup.cfg'.

    If you prefer to avoid building psycopg2 from source, please install the PyPI
    'psycopg2-binary' package instead.

    For further information please check the 'doc/src/install.rst' file (also at
    <https://www.psycopg.org/docs/install.html>).

    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Maybe this will help(pip install psycopg2). As I understand, there is kind of answer ( pg_config executable not found ).Maybe I'm wrong (99% guarantee, that I'm wrong, just because I'm new one in programming).

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM