-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
can't build with matplotlib #5075
Comments
@aglavic Can we have the runtime traceback? I'm aware that Conda numpy is broken and matplotlib>=3.3 is also causing issues with its data. It could be either of those or something new... |
Hi @bwoodsend, thanks for the quick reply. I'm not sure if you were referring to the traceback when building with pyinstaller or the execution of the package, so here are both logs: There is a warning about dependencies of the mkl libraries that numpy uses, but I can't finde these dlls anywhere on my system and another package that uses numpy worked. |
I meant the runtime log (your
Use the following to find conda dll locations: conda activate
where dll_name.dll Those particular dlls aren't present on my machine either so they hopefully are not needed.
|
The error in your error log has no proper Python stacktrace which is Conda's way of saying missing dll. I can't reproduce I'm afraid. It works fine for me but this is typical Conda - it could be accessing a dll anywhere on my machine (typically these dlls are also in other programs I have installed), giving me the illusion that the app works when it doesn't. We don't want to support Conda for exactly this (among many other) reasons. A missing dll should both be rare and easy to diagnose but with Conda it's neither. Please do us all a favour and use a normal Python with PyInstaller. You can have multiple installed alongside Conda without them getting in each other's way. If you're determined to use Conda then your next step would be to trace Python executing your script. In English this means appending something like the following to your code: import psutil
python = psutil.Process()
print(python.memory_maps()) Then compare the output filenames with what is being included in your app by PyInstaller. Doing this is incredibly tedious and time-consuming so the PyInstaller devs won't do this - you'll have to do it yourself and fix the hooks if you want this supported. |
Thank you so much for the tip with memory_maps. I could easily track down the issue by simply dumping the map before and after the command that crashed and diffing the result. For me it was just a missing libiomp5md.dll which I could copy to the exe path to solve this. |
Actually I probably should have told you at the start. |
Whilst I'm here also: - Exclude numpy's testing and C/Fortran compiling code, and everything else it drags with it (namely scipy). - Try to fix Conda support. - Avoid dragging 400MB of unused MKL DLLs on Conda. They're all closed due to our no-conda policy but, (for now) fixes pyinstaller#4935, pyinstaller#4968, pyinstaller#5075, pyinstaller#5082, pyinstaller#5019 and pyinstaller#5019. Although likely at the expense of junk DLLs being dragged in.
Whilst I'm here also: - Exclude numpy's testing and C/Fortran compiling code, and everything else it drags with it (namely scipy). - Try to fix Conda support. - Avoid dragging 400MB of unused MKL DLLs on Conda. They're all closed due to our no-conda policy but, (for now) fixes pyinstaller#4935, pyinstaller#4968, pyinstaller#5075, pyinstaller#5082, pyinstaller#5019 and pyinstaller#5019. Although likely at the expense of junk DLLs being dragged in.
I'm trying to get a program with embedded matplotlib graphs to build as .exe on windows 10 and no matter what I try the final program always crashes without error when run independently. I am building using an anaconda environment and when I start the .exe from that environment it does not crash.
I find the same behavior for the embedded examples of wxagg and qtagg, but this is the minimal example that does not work:
I have attached the example and the .yml file to create the anaconda environment from scratch here:
pyinstaller_issue_matplotlib.zip
I have tried with python 3.6 and 3.7, matplotlib 3.0.x, 3.1.x, 3.2.x and pyinstaller 3.4,3.5,3.6,4.0,4.1-dev and none seem to work.
Using the --debug all options I see it crashing after import of matplotlib.pylab (or matplotlib.backend_wxagg in the embedded example).
I got this working half a year ago, but I don't know what changed with the environment. Any help to track down the issue would be appreciated. (Or an environment definition that works.)
The text was updated successfully, but these errors were encountered: