Ughh - an inconsistent bug! Oh well at least it’s working.
As for your larger filesize - that is because of PyInstaller picking up optional dependencies and assuming you need them. The story usually goes: - A library you are using either has as a convenience matplotlib visualisation method in it or uses matplotlib somewhere hidden in its test suite. (In scipy’s case its scipy/optimize/_shgo_lib/triangulation.py.) - Matplotlib optionally supports every GUI library in existence as a backend to show it’s graphs with - it only needs one but PyInstaller includes all of them (so PyQt5, (deprecated) PyQt4, TKinter, PySide, Pyside2) as well as IPython’s inline-plotting support. - IPython uses all sorts of stuff so once PyInstaller sees that it wants to include more or less your entire conda environment. You can see this chain of inclusion in build/name/xref-name.html. If those modules aren’t installed then they are ignored. This is why you’ll see the advise everywhere to use a clean minimal environment for PyInstaller. Alternatively you can --exclude them. e.g. --exclude matplotlib --exclude PyQt5. Sometimes you can even exclude subpackages such as --exclude scipy.integrate. You can test if your script needs a package outside of PyInstaller by putting sys.modules["package_name"] = None at the top of your script and seeing if it can still run normally. If you don't get an import error, it's usually safe to exclude. I’d like to track down why your plain Python PyInstaller didn’t work - could you provide more details on that? Brénainn On Tuesday, June 23, 2020 at 11:50:50 AM UTC+1 [email protected] wrote: > Thank you very much for your note. > I did what you suggested (a very good idea), and it looks as if the scipy > packages are there: > [image: image] > > I launched the .exe file, and it completed without an error. Encouraged, I > ran again pyinstaller –F scipytest.py, and the resulting executable also > works! I have no idea what happened since day before yesterday when it did > not work. > Sine the Python pyinstaller did not work for me, I resorted to the > Anaconda pyinstaller which worked fine. I prefer the Python pyinstaller > because it runs much faster (about one minute versus a few minutes in > Anaconda) and produces much smaller .exe files (about 100MB, versus ~300MB > in Anaconda). > I saw indeed warnings in Anaconda documentation against using pip. Since I > want to use both Anaconda and Python, I will probably setup two separate > machines, one only with Python and the other only with Anaconda. > > Best, > Itsik > > *From:* bwoodsend > *Sent:* Monday, June 22, 2020 1:36 PM > *To:* PyInstaller > *Subject:* [PyInstaller] Re: Scipy Interpolate module > > scipy.interpolate is working no problem on my Windows. Scipy is on > PyInstaller’s list of packages which may require tight version control. I’m > using: > > python==3.7.7 > PyInstaller==3.6 > scipy==1.4.1 > > I also notice your using Anaconda which rearranges your package structures > in a way PyInstaller often can’t follow which can lead to files/packages > not being found. > > Can you build in 1-dir mode (the default), navigate inside the dist folder > and tell me if the scipy pyd files are in there? They should be under > dist\your_program\scipy\interpolate. Chances are they're not but it's a > place to start. > -- > You received this message because you are subscribed to the Google Groups > "PyInstaller" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/pyinstaller/fdc99e58-97a1-4da1-a19f-1067f76dc768n%40googlegroups.com > > <https://groups.google.com/d/msgid/pyinstaller/fdc99e58-97a1-4da1-a19f-1067f76dc768n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "PyInstaller" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/6be72ab4-0934-4ad3-a4cc-345808d9f2d4n%40googlegroups.com.
