带有Anaconda 3的Pyinstaller无法安装

时间:2018-09-03 16:35:17

标签: python anaconda pyinstaller

我正在尝试在Anaconda 3环境中使用pyinstaller编译exe。 任何想法如何解决此问题:

201 INFO: PyInstaller: 3.3.1
201 INFO: Python: 3.6.6
202 INFO: Platform: Linux-2.6.32-754.3.5.el6.x86_64-x86_64-with-centos-6.10-Final
........ SOME BLOAT.....
8666 INFO: Python library not in binary dependencies. Doing additional     searching...
Traceback (most recent call last):
  File "/home/rokner/miniconda3/envs/bisection/bin/pyinstaller", line 6, in     <module>
    ...BIG TRACEBACK ...
  File "/home/rokner/miniconda3/envs/bisection/lib/python3.6/site-    packages/PyInstaller/building/build_main.py", line 629, in _check_python_library
    raise IOError(msg)
OSError: Python library not found: libpython3.6.so.1.0,     libpython3.6mu.so.1.0, libpython3.6m.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)

我已经尝试为自己的操作系统(Cent OS 6.10)安装一些开发软件包,但是没有运气,因为使用的python位于conda env中。

1 个答案:

答案 0 :(得分:0)

如错误提示所示,未找到Python库。

要找出此错误,我编辑.bashrc并将Anaconda的python库lib设置为LD_LIBRARY_PATH

export LD_LIBRARY_PATH=/usr/local/anaconda3/lib:$LD_LIBRARY_PATH

然后,PyInstaller运行良好。

PS:我使用Python3.6.8,PyInstaller3.4开发了CentOS 6.5。