【问题标题】:pyinstaller build error or not run scriptpyinstaller 构建错误或不运行脚本
【发布时间】:2015-12-10 02:45:37
【问题描述】:

全部

我有一个python文件,现在我想用pyinstaller构建bin文件,但是pyinstall报这个错误

Traceback (most recent call last):
  File "/usr/local/bin/pyi-build", line 11, in <module>
    sys.exit(run())
  File "/usr/local/lib/python2.7/site-packages/PyInstaller/cliutils/build.py", line 37, in run
    PyInstaller.build.main(None, args[0], **opts.__dict__)
  File "/usr/local/lib/python2.7/site-packages/PyInstaller/build.py", line 1924, in main
    build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
  File "/usr/local/lib/python2.7/site-packages/PyInstaller/build.py", line 1873, in build
    execfile(spec)
  File "linux_server_script.spec", line 6, in <module>
    runtime_hooks=None)
  File "/usr/local/lib/python2.7/site-packages/PyInstaller/build.py", line 446, in __init__
    self.__postinit__()
  File "/usr/local/lib/python2.7/site-packages/PyInstaller/build.py", line 309, in __postinit__
    self.assemble()
  File "/usr/local/lib/python2.7/site-packages/PyInstaller/build.py", line 677, in assemble
    self._check_python_library(binaries)
  File "/usr/local/lib/python2.7/site-packages/PyInstaller/build.py", line 727, in _check_python_library
    raise IOError("Python library not found!")
IOError: Python library not found!

我的python首次构建没有使用--enable-shared,现在我重新编译python并添加选项“--enable-shared”,我将libpython*.so*复制到/usr/local/lib/,但是问题也。

如果我的导出 LD_LIBRARY_PATH=/usr/local/lib,可以构建成功,但是当我运行脚本时

[pyinstall@zixun-01 tmp]$ ./linux_server_script 加载 Python lib '/tmp/libpython2.7.so.1.0' 时出错:/tmp/libpython2.7.so.1.0:无法打开共享对象文件:没有这样的文件或目录

【问题讨论】:

    标签: python pyinstaller


    【解决方案1】:

    这是python库错误

    请删除 python 清理并重建 python 2.7 使用“./configure --enable-shared”

    并使用 pyinstall 选项“-p /usr/local/lib”来构建

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-05-09
      • 1970-01-01
      • 2019-01-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-05-30
      相关资源
      最近更新 更多