Collecting psycopg2==2.9.2 Using cached https://pypi.tuna.tsinghua.edu.cn/packages/33/ed/79434011d

在尝试通过pip安装psycopg2版本2.9.2时遇到错误,问题在于系统无法找到pg_config可执行文件,这是构建psycopg2库所需的。解决方案包括将包含pg_config的目录添加到PATH环境变量,或者通过提供pg_config的完整路径来运行安装命令。也可以选择安装预编译的psycopg2-binary包来避免从源代码构建。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Collecting psycopg2==2.9.2
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/33/ed/79434011d773e5ea4c51262f6ebfb86680c2908d7677f31ebccd5aa9f1b3/psycopg2-2.9.2.tar.gz (380 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [25 lines of output]
      running egg_info
      creating /tmp/pip-pip-egg-info-3h7lv2h3/psycopg2.egg-info
      writing /tmp/pip-pip-egg-info-3h7lv2h3/psycopg2.egg-info/PKG-INFO
      writing dependency_links to /tmp/pip-pip-egg-info-3h7lv2h3/psycopg2.egg-info/dependency_links.txt
      writing top-level names to /tmp/pip-pip-egg-info-3h7lv2h3/psycopg2.egg-info/top_level.txt
      writing manifest file '/tmp/pip-pip-egg-info-3h7lv2h3/psycopg2.egg-info/SOURCES.txt'
      /home/zhongke/anaconda3/envs/python3712/lib/python3.7/site-packages/setuptools/config/setupcfg.py:463: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
        warnings.warn(msg, warning_class)
      
      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>).
      
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

指定安装版本,当前版本不符合  :

如  pip3 install psycopg2==2.7.6 

Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Collecting tensorflow-gpu==2.5.0 Downloading https://pypi.tuna.tsinghua.edu.cn/packages/56/23/76efd2d809706ade990c4481b608dc3ebd47df83f5069af86da97a10f93e/tensorflow_gpu-2.5.0-cp38-cp38-manylinux2010_x86_64.whl (454.4 MB)  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 454.4/454.4 MB 1.2 MB/s eta 0:00:0000:0100:09 [?25hCollecting imageio Using cached https://pypi.tuna.tsinghua.edu.cn/packages/1e/b7/02adac4e42a691008b5cfb31db98c190e1fc348d1521b9be4429f9454ed1/imageio-2.35.1-py3-none-any.whl (315 kB) Collecting numpy~=1.19.2 (from tensorflow-gpu==2.5.0) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/66/d7/3b133b17e185f14137bc8afe7a41daf1f31556900f10238312a5ae9c7345/numpy-1.19.5-cp38-cp38-manylinux2010_x86_64.whl (14.9 MB) Collecting absl-py~=0.10 (from tensorflow-gpu==2.5.0) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/97/75/f5e61fb67ecbe45c31035b17562464e11b91a2b8a351bae5ca0db2969e3b/absl_py-0.15.0-py3-none-any.whl (132 kB) Collecting astunparse~=1.6.3 (from tensorflow-gpu==2.5.0) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/2b/03/13dde6512ad7b4557eb792fbcf0c653af6076b81e5941d36ec61f7ce6028/astunparse-1.6.3-py2.py3-none-any.whl (12 kB) Collecting flatbuffers~=1.12.0 (from tensorflow-gpu==2.5.0) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/eb/26/712e578c5f14e26ae3314c39a1bdc4eb2ec2f4ddc89b708cf8e0a0d20423/flatbuffers-1.12-py2.py3-none-any.whl (15 kB) Collecting google-pasta~=0.2 (from tensorflow-gpu==2.5.0) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/a3/de/c648ef6835192e6e2cc03f40b19eeda4382c49b5bafb43d88b931c4c74ac/google_pasta-0.2.0-py3-none-any.whl (57 kB) Collecting h5py~=3.1.0 (from tensorflow-gpu==2.5.0) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/67/b2/c20d2f11ca86132f70799da2fc213772676025f556e1f4404754d000600a/h5py-3.1.0-cp38-cp38-manylinux1_x86_64.whl (4.4 MB) Collecting keras-preprocessing~=1.1.2 (from tensorflow-gpu==2.5.0) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/79/4c/7c3275a01e12ef9368a892926ab932b33bb13d55794881e3573482b378a7/Keras_Preprocessing-1.1.2-py2.py3-none-any.whl (42 kB) Collecting opt-einsum~=3.3.0 (from tensorflow-gpu==2.5.0) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/bc/19/404708a7e54ad2798907210462fd950c3442ea51acc8790f3da48d2bee8b/opt_einsum-3.3.0-py3-none-any.whl (65 kB) Collecting protobuf>=3.9.2 (from tensorflow-gpu==2.5.0) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/85/e4/07c80521879c2d15f321465ac24c70efe2381378c00bf5e56a0f4fbac8cd/protobuf-5.29.5-cp38-abi3-manylinux2014_x86_64.whl (319 kB) Collecting six~=1.15.0 (from tensorflow-gpu==2.5.0) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/ee/ff/48bde5c0f013094d729fe4b0316ba2a24774b3ff1c52d924a8a4cb04078a/six-1.15.0-py2.py3-none-any.whl (10 kB) Collecting termcolor~=1.1.0 (from tensorflow-gpu==2.5.0) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/8a/48/a76be51647d0eb9f10e2a4511bf3ffb8cc1e6b14e9e4fab46173aa79f981/termcolor-1.1.0.tar.gz (3.9 kB) Preparing metadata (setup.py) ... [?25ldone [?25hCollecting typing-extensions~=3.7.4 (from tensorflow-gpu==2.5.0) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/60/7a/e881b5abb54db0e6e671ab088d079c57ce54e8a01a3ca443f561ccadb37e/typing_extensions-3.7.4.3-py3-none-any.whl (22 kB) Requirement already satisfied: wheel~=0.35 in /data2/shizhongxi/.conda/envs/mmlab/lib/python3.8/site-packages (from tensorflow-gpu==2.5.0) (0.44.0) Collecting wrapt~=1.12.1 (from tensorflow-gpu==2.5.0) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/82/f7/e43cefbe88c5fd371f4cf0cf5eb3feccd07515af9fd6cf7dbf1d1793a797/wrapt-1.12.1.tar.gz (27 kB) Preparing metadata (setup.py) ... [?25ldone [?25hCollecting gast==0.4.0 (from tensorflow-gpu==2.5.0) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/b6/48/583c032b79ae5b3daa02225a675aeb673e58d2cb698e78510feceb11958c/gast-0.4.0-py3-none-any.whl (9.8 kB) Collecting tensorboard~=2.5 (from tensorflow-gpu==2.5.0) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/bc/a2/ff5f4c299eb37c95299a76015da3f30211468e29d8d6f1d011683279baee/tensorboard-2.14.0-py3-none-any.whl (5.5 MB) Collecting tensorflow-estimator<2.6.0,>=2.5.0rc0 (from tensorflow-gpu==2.5.0) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/ec/78/b27f73e923becc6e79e18fe112cf75e3200d1ee35b0dba8fa46181bce56c/tensorflow_estimator-2.5.0-py2.py3-none-any.whl (462 kB) INFO: pip is looking at multiple versions of tensorflow-gpu to determine which version is compatible with other requirements. This could take a while. 31mERROR: Could not find a version that satisfies the requirement keras-nightly~=2.5.0.dev (from tensorflow-gpu) (from versions: none) 31mERROR: No matching distribution found for keras-nightly~=2.5.0.dev
最新发布
07-24
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值