Just a note: Anaconda supplies a complete Python install that is not-very-different than the one from Python.org. And the PyInstaller that it supplies is the same as well (modulo the version).
The one way that Anaconda IS different with regard to PyInstaller is that it supplies compiled C libraries as well, and these may be in different places. Though usually PyInstaller can find them. Another difference is that some versions of Anaconda use the Intel MKL math libs, which can be pretty darn big. So: most of the differences you are seeing is not due to using Anaconda, but rather something about configuration and PyInstaller version. -CHB On Tue, Jun 23, 2020 at 8:25 AM bwoodsend <[email protected]> wrote: > 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 > <https://groups.google.com/d/msgid/pyinstaller/6be72ab4-0934-4ad3-a4cc-345808d9f2d4n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception [email protected] -- 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/CALGmxELCnKfCqQW%2BpAUH3q5%2B5eK1bR%2BSiRHMreW7%2BcJKtQXnQw%40mail.gmail.com.
