简体   繁体   English

带有Anaconda 3的Pyinstaller无法安装

[英]Pyinstaller with Anaconda 3 can't install

I'm trying to compile an exe with pyinstaller inside an Anaconda 3 environment. 我正在尝试在Anaconda 3环境中使用pyinstaller编译exe。 Any idea how to fix this: 任何想法如何解决此问题:

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)

I've tried installing some dev packages for my OS(Cent OS 6.10) but with no luck because the python used is in a conda env. 我已经尝试为我的操作系统(Cent OS 6.10)安装一些开发包,但是没有运气,因为使用的python在conda env中。

As the error hint shows, the Python library is not found. 如错误提示所示, 找不到Python库。

To figure out this error, I edit .bashrc and set python library lib of Anaconda to LD_LIBRARY_PATH : 为了找出这个错误,我编辑.bashrc并将Anaconda的python库lib设置为LD_LIBRARY_PATH

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

Then, PyInstaller works well. 然后,PyInstaller运行良好。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM