简体   繁体   中英

Pyinstaller with Anaconda 3 can't install

I'm trying to compile an exe with pyinstaller inside an Anaconda 3 environment. 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.

As the error hint shows, the Python library is not found.

To figure out this error, I edit .bashrc and set python library lib of Anaconda to LD_LIBRARY_PATH :

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

Then, PyInstaller works well.

PS: I worked on CentOS 6.5 with Python3.6.8,PyInstaller3.4.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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