自学内容网 自学内容网

python import 私有依赖报错处理合集

1、pip install 私有依赖过程中编译psycopg2 错误

具体报错:

libpq-fe.h: No such file or directory
You may install a binary package by installing ‘psycopg2-binary’ from PyPI.
If you want to install psycopg2 from source, please install the packages
required for the build and try again.

解决方案:

  • centos
yum install postgresql-devel -y
pip install psycopg2
  • ubantu:
apt-get install libpq-dev
pip install psycopg2

2、pip install 私有依赖过程中编译pyarrow错误

具体报错:
– checking for module ‘arrow’
– package ‘arrow’ not found
CMake Error at /usr/local/share/cmake-3.2/Modules/FindPackageHandleStandardArgs.cmake:138 (message):
Could NOT find Arrow (missing: ARROW_INCLUDE_DIR ARROW_LIB_DIR
ARROW_FULL_SO_VERSION ARROW_SO_VERSION)

过程分析:
1、执行pip install arrow发现已经安装,使用pip show arrow版本1.3.0也是对;

2、因为环境中存在多个不同版本的python(python3.10.5、python3.11),导致在pip install pyarrow(pip 23.2.1 python 3.11)时存在相同问题。

解决问题:
因为项目使用pyarrow=9.0.0 python3.10.5,所以我们对应python版本下载pyarrow

python3.10 -m pip install pyarrow==9.0.0 -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com

ps:
pyarrow版本越高,所要求的服务器cmake版本越高。

本次适用于:centos7、redhet7、cmake3.2.0


原文地址:https://blog.csdn.net/qq_41372916/article/details/143601414

免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!