linux python库文件在哪,在Linux上的pyinstaller中找不到Python库

我在Linux中安装了python$ which python

/grid/common/pkgs/python/v2.7.6/bin/python

还有pyinstaller

^{pr2}$

/grid/common/pkgs/python/v2.7.6/bin/pyinstaller

现在我创建了一个示例python文件你好.py在/home/username/test/目录中print "Hello World!!"

使用pyinstaller,当我试图使用下面的命令为它创建可执行文件时,我得到了IOError:Python library not found:libpython2.7穆。索.1.0,libpython2.7.so.1.0,libpython2.7m.so.1.0:$ pyinstaller hello.py

532 INFO: PyInstaller: 3.2.1

532 INFO: Python: 2.7.6

534 INFO: Platform: Linux-2.6.18-371.el5-x86_64-with-redhat-5.10-Tikanga

536 INFO: wrote /home/username/test/hello.spec

591 INFO: UPX is not available.

602 INFO: Extending PYTHONPATH with paths

['/home/username/test', '/home/username/test']

602 INFO: checking Analysis

602 INFO: Building Analysis because out00-Analysis.toc is non existent

603 INFO: Initializing module dependency graph...

639 INFO: Initializing module graph hooks...

757 INFO: running Analysis out00-Analysis.toc

819 INFO: Caching module hooks...

858 INFO: Analyzing /home/username/test/hello.py

859 INFO: Loading module hooks...

860 INFO: Loading module hook "hook-encodings.py"...

6735 INFO: Looking for ctypes DLLs

6736 INFO: Analyzing run-time hooks ...

6741 INFO: Looking for dynamic libraries

7285 INFO: Looking for eggs

7286 INFO: Python library not in binary depedencies. Doing additional searching...

Traceback (most recent call last):

File "/grid/common/pkgs/python/v2.7.6/bin/pyinstaller", line 9, in

load_entry_point('PyInstaller==3.2.1', 'console_scripts', 'pyinstaller')()

File "/grid/common/pkgs/python/v2.7.6/lib/python2.7/site-

packages/PyInstaller-3.2.1-py2.7.egg/PyInstaller/__main__.py", line 90, in run

run_build(pyi_config, spec_file, **vars(args))

File "/grid/common/pkgs/python/v2.7.6/lib/python2.7/site-

packages/PyInstaller-3.2.1-py2.7.egg/PyInstaller/__main__.py", line 46, in

run_build

PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)

File "/grid/common/pkgs/python/v2.7.6/lib/python2.7/site-

packages/PyInstaller-3.2.1-py2.7.egg/PyInstaller/building/build_main.py",

line 788, in main

build(specfile, kw.get('distpath'), kw.get('workpath'),

kw.get('clean_build'))

File "/grid/common/pkgs/python/v2.7.6/lib/python2.7/site-

packages/PyInstaller-3.2.1-py2.7.egg/PyInstaller/building/build_main.py",

line 734, in build

exec(text, spec_namespace)

File "", line 16, in

File "/grid/common/pkgs/python/v2.7.6/lib/python2.7/site-

packages/PyInstaller-3.2.1-py2.7.egg/PyInstaller/building/build_main.py",

line 212, in __init__

self.__postinit__()

File "/grid/common/pkgs/python/v2.7.6/lib/python2.7/site-

packages/PyInstaller-3.2.1-py2.7.egg/PyInstaller/building/datastruct.py",

line 161, in __postinit__

self.assemble()

File "/grid/common/pkgs/python/v2.7.6/lib/python2.7/site-

packages/PyInstaller-3.2.1-py2.7.egg/PyInstaller/building/build_main.py",

line 543, in assemble

self._check_python_library(self.binaries)

File "/grid/common/pkgs/python/v2.7.6/lib/python2.7/site-

packages/PyInstaller-3.2.1-py2.7.egg/PyInstaller/building/build_main.py",

line 626, in _check_python_library

raise IOError(msg)

IOError: Python library not found: libpython2.7mu.so.1.0,

libpython2.7.so.1.0, libpython2.7m.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)

请任何人告诉我如何解决这个错误和创建一个单一的可执行文件使用它。在

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值