zoukankan      html  css  js  c++  java
  • ubuntu 安装psycopg2包

    psycopg2 库是 python 用来操作 postgreSQL 数据库的第三方库。

    执行:pip3 install psycopg2==2.8.4

    有可能会报错:

    Collecting psycopg2==2.8.4
      Downloading https://files.pythonhosted.org/packages/84/d7/6a93c99b5ba4d4d22daa3928b983cec66df4536ca50b22ce5dcac65e4e71/psycopg2-2.8.4.tar.gz (377kB)
        100% |████████████████████████████████| 378kB 1.1MB/s 
        Complete output from command python setup.py egg_info:
        running egg_info
        creating pip-egg-info/psycopg2.egg-info
        writing top-level names to pip-egg-info/psycopg2.egg-info/top_level.txt
        writing dependency_links to pip-egg-info/psycopg2.egg-info/dependency_links.txt
        writing pip-egg-info/psycopg2.egg-info/PKG-INFO
        writing manifest file 'pip-egg-info/psycopg2.egg-info/SOURCES.txt'
        /usr/lib/python3.5/distutils/dist.py:261: UserWarning: Unknown distribution option: 'project_urls'
          warnings.warn(msg)
        /usr/lib/python3.5/distutils/dist.py:261: UserWarning: Unknown distribution option: 'python_requires'
          warnings.warn(msg)
        warning: manifest_maker: standard file '-c' not found
        
        
        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
        <http://initd.org/psycopg/docs/install.html>).
        
        
        ----------------------------------------
    Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-txs3m3mb/psycopg2/

    解决方法

    sudo apt-get install postgresql
    sudo apt-get install python-psycopg2
    sudo apt-get install libpq-dev
    pip3 install psycopg2==2.8.4
  • 相关阅读:
    解决:Requested 'libdrm_radeon >= 2.4.56' but version of libdrm_radeon is 2.4.52
    解决Ubuntun 12.04编译Mesa10.3 WARNING: 'aclocal-1.14' is missing on your system
    交叉编译Mesa,X11lib,Qt opengl
    Qt5.4.1移植到arm——Linuxfb篇
    Qt5.3.0的安装与测试
    gstreamer——文档/资源/使用
    gst-rtsp-server编译测试
    gstreamer-tips-picture-in-picture-compositing
    Matlab实现加性高斯白噪声信道(AWGN)下的digital调制格式识别分类
    Matlab实现单(双)极性(不)归零码
  • 原文地址:https://www.cnblogs.com/daofaziran/p/12604879.html
Copyright © 2011-2022 走看看