pyinstaller 打包错误,OSError: Python library not found: libpython3.4mu.so.1.0, libpython3.4m.so.1.0, libpython3.4.so.1.0

错误提示如下:

24 INFO: PyInstaller: 3.2.1
25 INFO: Python: 3.4.1
25 INFO: Platform: Linux-2.6.32-220.el6.x86_64-x86_64-with-centos-6.2-Final
26 INFO: wrote /home/fmwei/src/lxa.spec
27 INFO: UPX is not available.
29 INFO: Extending PYTHONPATH with paths
['/home/fmwei/src', '/home/fmwei/src']
29 INFO: checking Analysis
29 INFO: Building Analysis because out00-Analysis.toc is non existent
29 INFO: Initializing module dependency graph...
30 INFO: Initializing module graph hooks...
31 INFO: Analyzing base_library.zip ...
1023 INFO: Processing pre-find module path hook   distutils
1814 INFO: running Analysis out00-Analysis.toc
1821 INFO: Caching module hooks...
1825 INFO: Analyzing /home/fmwei/src/lxa.py
1861 INFO: Loading module hooks...
1861 INFO: Loading module hook "hook-encodings.py"...
1906 INFO: Loading module hook "hook-pydoc.py"...
1906 INFO: Loading module hook "hook-xml.py"...
2048 INFO: Loading module hook "hook-distutils.py"...
2058 INFO: Looking for ctypes DLLs
2058 INFO: Analyzing run-time hooks ...
2066 INFO: Looking for dynamic libraries
2353 INFO: Looking for eggs
2353 INFO: Python library not in binary depedencies. Doing additional searching...
Traceback (most recent call last):
  File "/usr/local/python34/bin/pyinstaller", line 9, in <module>
    load_entry_point('PyInstaller==3.2.1', 'console_scripts', 'pyinstaller')()
  File "/usr/local/python34/lib/python3.4/site-packages/PyInstaller/__main__.py", line 90, in run
    run_build(pyi_config, spec_file, **vars(args))
  File "/usr/local/python34/lib/python3.4/site-packages/PyInstaller/__main__.py", line 46, in run_build
    PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
  File "/usr/local/python34/lib/python3.4/site-packages/PyInstaller/building/build_main.py", line 788, in main
    build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
  File "/usr/local/python34/lib/python3.4/site-packages/PyInstaller/building/build_main.py", line 734, in build
    exec(text, spec_namespace)
  File "<string>", line 16, in <module>
  File "/usr/local/python34/lib/python3.4/site-packages/PyInstaller/building/build_main.py", line 212, in __init__
    self.__postinit__()
  File "/usr/local/python34/lib/python3.4/site-packages/PyInstaller/building/datastruct.py", line 161, in __postinit__
    self.assemble()
  File "/usr/local/python34/lib/python3.4/site-packages/PyInstaller/building/build_main.py", line 543, in assemble
    self._check_python_library(self.binaries)
  File "/usr/local/python34/lib/python3.4/site-packages/PyInstaller/building/build_main.py", line 626, in _check_python_library
    raise IOError(msg)
OSError: Python library not found: libpython3.4mu.so.1.0, libpython3.4m.so.1.0, libpython3.4.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)

大概意思就是pyinstaller报错找不到python动态库,也提示说升级python-dev。因为我是centos,各种yum install python-develyum install python-dev都不行,什么升级/重装python、sudo、su甚至重装系统都不行!!!我又必须在centos6.2环境下编译,如果我在其他高版本的环境下打包后拿到centos6.2就会报错,言归正传!其实处理起来很简单。只需要复制python安装目录下的动态库到系统地动态库目录即可。
cp -R /usr/local/python3.4/lib/* /usr/lib64/ 这样就搞定了!
再次打包顺利完成!

标签: libpython3.4mu.so.1.0, pyinstaller, libpython3.5mu.so.1.0

已有 3 条评论

  1. 伤感因泪水而变得清澈透明,不带泪水的伤感却比落泪的伤感更伤人。流泪的伤感,经过泪水的冲刷,伤口就会慢慢愈合;无泪的伤感,伤口最深,愈合所需的时间也会比较长。

  2. 一个人的小巷,有薄暮夕阳的浪漫,拾起阡陌边的稻草,放进嘴里嚼。一个人的海洋,有碧海蓝天的忧伤,踢着悠悠浮动的水草,让心洋轻轻荡。一个人的小街,有落雨缤纷的凄美,打着同样缤纷的伞,看电影散场的人,游走在纷扰的边缘。

  3. 思绪不断阻挡着回忆播放,盲目的追寻仍然空空荡荡,灰蒙蒙的夜晚睡意又不知躲到哪去,一转身孤单已躺在身旁。

添加新评论