WxPython: PyInstaller fails with No module named _core_

后端 未结 2 461
星月不相逢
星月不相逢 2021-01-12 10:10

I am converting my wxpython (3.0.2.0) application to binaries using PyInstaller. The binaries work fine when built and executed on Ubuntu 12.04. However if I build on Ubuntu

2条回答
  •  粉色の甜心
    2021-01-12 10:59

    Fundamentally the problem is with the PyInstaller version - you need to be on the develop version. This issue has been seen and is documented on a PyInstaller Github issue.

    To install the latest version and rectify - at the command prompt type:

    $ pip install git+https://github.com/pyinstaller/pyinstaller
    

    This directly installs the latest version of pyinstaller from github (this branch on github. Until recently, PyInstaller had a separate python3 branch, but this has been merged back into the develop branch. If you need to use Python 3.x, you will need this branch - get this by appending @develop to the pip install command)

    The above method relies on you having git installed on your system to get the pyinstaller code (pretty likely for a developer these days, I guess). If not, you can either

    1. install git using apt-get install git (you might need to sudo that)
    2. download the pyinstaller-develop zip file (here) and install manually. Note as per the wiki as of Oct 2014, this should support 2.7 and 3.x.

    Personally - I much prefer option 1 as you avoid all the potential problems of building from a zipped source tree yourself.

    Testing

    I tested this on Ubuntu 14.04, 64 bit, wxpython 3.0.2.0 with python 2.7.6, using the simple "Hello world" app from the wxPython webpage. The OP's issue reproduced exactly before installing pyinstaller develop version. After installing the develop version the app built correctly and ran as an executable.


    Documentation of using pip with git - https://pip.pypa.io/en/latest/reference/pip_install.html#git

    It is not clear from your question which versions of PyInstaller you are using on your Ubuntu 12.04 install vs the 14.04 version. It seems that the version you have on 12.04 does not exhibit the same issue as the standard version installed on 14.04.

提交回复
热议问题