linux 打包python程序到exe

报错:

OSError: Python library not found: libpython3.6m.so.1.0, libpython3.6.so.1.0, libpython3.6mu.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.

 

http://blog.sina.com.cn/s/blog_6d24cc4e0102y4od.html
抱着吃水不忘挖井人的想法,https://pyinstaller.readthedocs.io/en/v3.3.1/when-things-go-wrong.html#build-time-python-errors

上面是官网报错,对于这个报错,其实是动态链接库的问题,在这里,我们要知道为什么动态链接库连接不上,是因为你的LD_LIBRARY_PATH 没有设置,将python3.6的环境链接一下,我这里直接将

export LD_LIBRARY_PATH=/home/comprehend/anaconda3/lib/python3.6/site-packages:$LD_LIBRARY_PATH放到环境变量中,再次之前我将位于/home/comprehend/anaconda3/lib里面的离别python3.6m.so.1.0 复制到了site-packages,现在测试一下是不是将/home/comprehend/anaconda3/lib防盗环境变量中,去掉上面的,发现做到了,就是这个so文件的问题,我们要把这个so文件的路径防盗LD_LIBARY_PATH 中

The places where PyInstaller looks for the python library are different in different operating systems, but /lib and /usr/lib are checked in most systems. If you cannot put the python library there, try setting the correct path in the environment variable LD_LIBRARY_PATH in Linux orDYLD_LIBRARY_PATH in OS X.

你可能感兴趣的:(轮子)