• 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
  • 相关阅读:
    Visual Studio 起始页面关闭新闻等
    Windows 10磁盘占用100%解决办法
    关于android:windowNoTitle不起作用的解决办法
    Android TextView 文字居中
    android studio上传项目到github报错Successfully created project 'Demo' on GitHub, but initial commit failed:
    Android开发中string.xml文件的使用
    Android TextView内容过长加省略号,点击显示全部内容
    Retrofit2访问数据的例子,kotlin和anko
    Android提高21篇之一:MediaPlayer
    android4.0蓝牙使能的详细解析
  • 原文地址:https://www.cnblogs.com/daofaziran/p/12604879.html
Copyright © 2020-2023  润新知