user32882
user32882

Reputation: 5877

Problems with PyInstaller

I would like to bundle an application into an executable using PyInstaller. I am having issues because of the geopandas library. Currently my script throwaway.py contains only the following import:

import geopandas

However running pyinstaller throwaway.py does not work. It appears to have problems with PyQt5 which only matplotlib imports.

The log for pyinstalleris too long to include here however the following shows the last exception encountered:

Exception:
            Cannot find existing PyQt5 plugin directories
            Paths checked: c:/qt/qt_1489878162099/_b_env/Library/plugins

I am not sure how to approach this, but there are a couple of conceptual options:

What can I do next?

Upvotes: 2

Views: 2625

Answers (2)

user32882
user32882

Reputation: 5877

I solved this problem by downloading the development version of pyinstaller as follows:

pip install https://github.com/pyinstaller/pyinstaller/archive/develop.zip

I got the above from this link. The current conda-forge distribution of pyinstaller still does not include this change which is included in the development version. The code prior to that change is what was causing the error in the question to occur.

Hopefully the conda-forge distribution will soon come to incorporate this into the main distribution.

So basically if you are experiencing this problem you have two choices:

  • Install development version of PyInstaller and use that
  • Manually go inside the ~\anaconda3\Lib\site-packages\PyInstaller\utils\hooks\qt.py and modify the file as indicated here

Upvotes: 1

Panos Kalatzantonakis
Panos Kalatzantonakis

Reputation: 12683

This pyinstaller -y -d --clean throwaway.py works for me.

enter image description here

Also, check this question.

There is an issue with the recursing limit, stated here. Try to increase it like this:

import sys
sys.setrecursionlimit(5000)

Upvotes: 2

Related Questions