欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

解決pip install psycopg2出錯問題

 更新時間:2020年07月09日 10:17:24   作者:喝粥也會胖的唐僧  
這篇文章主要介紹了解決pip install psycopg2出錯問題。具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧

pip install psycopg2出現(xiàn)錯誤:

Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting psycopg2
 Using cached https://pypi.tuna.tsinghua.edu.cn/packages/84/d7/6a93c99b5ba4d4d22daa3928b983cec66df4536ca50b22ce5dcac65e4e71/psycopg2-2.8.4.tar.gz (377 kB)
 ERROR: Command errored out with exit status 1:
  command: /opt/AN/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-lkf6b0y5/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-lkf6b0y5/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 /tmp/pip-install-lkf6b0y5/psycopg2/pip-egg-info
   cwd: /tmp/pip-install-lkf6b0y5/psycopg2/
 Complete output (23 lines):
 running egg_info
 creating /tmp/pip-install-lkf6b0y5/psycopg2/pip-egg-info/psycopg2.egg-info
 writing /tmp/pip-install-lkf6b0y5/psycopg2/pip-egg-info/psycopg2.egg-info/PKG-INFO
 writing dependency_links to /tmp/pip-install-lkf6b0y5/psycopg2/pip-egg-info/psycopg2.egg-info/dependency_links.txt
 writing top-level names to /tmp/pip-install-lkf6b0y5/psycopg2/pip-egg-info/psycopg2.egg-info/top_level.txt
 writing manifest file '/tmp/pip-install-lkf6b0y5/psycopg2/pip-egg-info/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
 <http://initd.org/psycopg/docs/install.html>).
 
 ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

解決方法:

yum install postgresql postgresql-devel python-devel python3-devel

補充知識:anaconda 通過pip 安裝python psycopg2

1. 【不能在cmd里install】之前一直在 cmd 里conda install psycopg2 ,pip install psycopg2,雖然提示安裝成功,但是import時還是會報錯提示包不存在。

2. 【在prompt里pip】正確的安裝方法是,安裝完成 anaconda,進入anaconda prompt,輸入命令即可

pip install psycopg2

3. import psycopg2 未報錯,安裝成功。

以上這篇解決pip install psycopg2出錯問題就是小編分享給大家的全部內(nèi)容了,希望能給大家一個參考,也希望大家多多支持腳本之家。

相關(guān)文章

  • 關(guān)于python多進程中的常用方法詳解

    關(guān)于python多進程中的常用方法詳解

    這篇文章主要介紹了關(guān)于python多進程中的常用方法詳解,python中的多線程其實并不是真正的多線程,如果想要充分地使用多核CPU資源,在python中大部分情況需要使用多進程,需要的朋友可以參考下
    2023-07-07
  • Python全面分析系統(tǒng)的時域特性和頻率域特性

    Python全面分析系統(tǒng)的時域特性和頻率域特性

    今天小編就為大家分享一篇Python全面分析系統(tǒng)的時域特性和頻率域特性,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧
    2020-02-02
  • np.concatenate()函數(shù)的具體使用

    np.concatenate()函數(shù)的具體使用

    本文主要介紹了np.concatenate()函數(shù)的具體使用,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2023-03-03
  • python實現(xiàn)socket端口重定向示例

    python實現(xiàn)socket端口重定向示例

    這篇文章主要介紹了python實現(xiàn)的socket端口重定向示例,實現(xiàn)功能是在端口12345開啟文件共享,此時我也想通過8000端口同時訪問此共享
    2014-02-02
  • Python 隨機生成中文驗證碼的實例代碼

    Python 隨機生成中文驗證碼的實例代碼

    Python 隨機生成中文驗證碼的實例代碼,需要的朋友可以參考一下
    2013-03-03
  • Python全面解析json數(shù)據(jù)并保存為csv文件

    Python全面解析json數(shù)據(jù)并保存為csv文件

    這篇文章主要介紹了Python全面解析json數(shù)據(jù)并保存為csv文件,具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教
    2022-07-07
  • 利用Python批量識別電子賬單數(shù)據(jù)的方法

    利用Python批量識別電子賬單數(shù)據(jù)的方法

    這篇文章主要介紹了利用Python批量識別電子賬單數(shù)據(jù)的方法,本文給大家介紹的非常詳細(xì),對大家的學(xué)習(xí)或工作具有一定的參考借鑒價值,需要的朋友可以參考下
    2021-02-02
  • python順序執(zhí)行多個py文件的方法

    python順序執(zhí)行多個py文件的方法

    今天小編大家分享一篇python順序執(zhí)行多個py文件的方法,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧
    2019-06-06
  • Python flask框架如何顯示圖像到web頁面

    Python flask框架如何顯示圖像到web頁面

    這篇文章主要介紹了Python flask框架如何顯示圖像到web頁面,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友可以參考下
    2020-06-06
  • 超詳細(xì)OpenMV與STM32單片機通信 附完整源碼

    超詳細(xì)OpenMV與STM32單片機通信 附完整源碼

    這篇文章主要介紹了OpenMV與STM32單片機通信的相關(guān)知識,在文章結(jié)尾給大家提供了項目源碼,需要的朋友可以參考下
    2021-11-11

最新評論