【发布时间】:2025-11-24 05:05:01
【问题描述】:
我安装了rh-python38-python-devel.x86_64.3.8.6-1.el7 和pyinstaller-4.3,但仍然失败:
28267 INFO: Python library not in binary dependencies. Doing additional searching...
Traceback (most recent call last):
File "/opt/rh/rh-python38/root/usr/local/bin/pyinstaller", line 8, in <module>
sys.exit(run())
File "/opt/rh/rh-python38/root/usr/local/lib/python3.8/site-packages/PyInstaller/__main__.py", line 114, in run
run_build(pyi_config, spec_file, **vars(args))
File "/opt/rh/rh-python38/root/usr/local/lib/python3.8/site-packages/PyInstaller/__main__.py", line 65, in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
File "/opt/rh/rh-python38/root/usr/local/lib/python3.8/site-packages/PyInstaller/building/build_main.py", line 737, in main
build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
File "/opt/rh/rh-python38/root/usr/local/lib/python3.8/site-packages/PyInstaller/building/build_main.py", line 684, in build
exec(code, spec_namespace)
File "cmd.spec", line 7, in <module>
a = Analysis(['gooddata/cmd/__main__.py'],
File "/opt/rh/rh-python38/root/usr/local/lib/python3.8/site-packages/PyInstaller/building/build_main.py", line 242, in __init__
self.__postinit__()
File "/opt/rh/rh-python38/root/usr/local/lib/python3.8/site-packages/PyInstaller/building/datastruct.py", line 160, in __postinit__
self.assemble()
File "/opt/rh/rh-python38/root/usr/local/lib/python3.8/site-packages/PyInstaller/building/build_main.py", line 476, in assemble
self._check_python_library(self.binaries)
File "/opt/rh/rh-python38/root/usr/local/lib/python3.8/site-packages/PyInstaller/building/build_main.py", line 581, in _check_python_library
python_lib = bindepend.get_python_library_path()
File "/opt/rh/rh-python38/root/usr/local/lib/python3.8/site-packages/PyInstaller/depend/bindepend.py", line 956, in get_python_library_path
raise IOError(msg)
OSError: Python library not found: libpython3.8m.so.1.0, libpython3.8mu.so.1.0, libpython3.8m.so, libpython3.8.so.1.0
This would mean your Python installation doesn't come with proper library files.
This usually happens by missing development package, or unsuitable build parameters of Python installation.
* On Debian/Ubuntu, you would need to install Python development packages
* apt-get install python3-dev
* apt-get install python-dev
* If you're building Python by yourself, please rebuild your Python with `--enable-shared` (or, `--enable-framework` on Darwin)
安装的python3包:
> yum list installed | grep python3
rh-python38.x86_64 2.0-4.el7 @centos-sclo-rh
rh-python38-python.x86_64 3.8.6-1.el7 @centos-sclo-rh
rh-python38-python-devel.x86_64 3.8.6-1.el7 @centos-sclo-rh
rh-python38-python-libs.x86_64 3.8.6-1.el7 @centos-sclo-rh
rh-python38-python-pip.noarch 19.3.1-1.el7 @centos-sclo-rh
rh-python38-python-pip-wheel.noarch 19.3.1-1.el7 @centos-sclo-rh
rh-python38-python-rpm-macros.noarch 3.8.6-1.el7 @centos-sclo-rh
rh-python38-python-setuptools.noarch 41.6.0-7.el7 @centos-sclo-rh
rh-python38-python-setuptools-wheel.noarch
rh-python38-runtime.x86_64 2.0-4.el7 @centos-sclo-rh
使用 pip 安装的 Pyinstaller:
> scl enable rh-python38 'pip list installed'
Package Version
------------------------- ---------
altgraph 0.17
awscli 1.19.53
botocore 1.20.53
certifi 2020.12.5
cffi 1.14.5
chardet 4.0.0
colorama 0.4.3
cryptography 3.4.7
docutils 0.15.2
greenlet 1.0.0
idna 2.10
importlib-metadata 4.0.0
JayDeBeApi 1.2.3
jeepney 0.6.0
jmespath 0.10.0
joblib 1.0.1
JPype1 1.2.1
keyring 23.0.1
numpy 1.20.2
pandas 1.2.4
pip 21.0.1
pyasn1 0.4.8
pycparser 2.20
pyinstaller 4.3
pyinstaller-hooks-contrib 2021.1
python-dateutil 2.8.1
pytz 2021.1
PyYAML 5.4.1
requests 2.25.1
rsa 4.7.2
s3transfer 0.3.7
scikit-learn 0.24.1
scipy 1.6.2
SecretStorage 3.3.1
setuptools 56.0.0
six 1.15.0
SQLAlchemy 1.4.7
tabulate 0.8.9
threadpoolctl 2.1.0
urllib3 1.26.4
zipp 3.4.1
【问题讨论】:
标签: python-3.x pyinstaller centos7