Scipy Interpolate module

60 views
Skip to first unread message

Prateek Maheshwari

unread,
Jan 27, 2020, 10:46:28 AM1/27/20
to PyInstaller
I m trying to make a exe using interpolate of scipy.
Installer is created successfully.
While executing command from cmd on windows it gives following error.




scipyInterpolate.PNG



Yitzhak Weissman

unread,
Jun 22, 2020, 3:39:18 AM6/22/20
to PyInstaller
Same happened to me. Did you find a solution or workaround?

bwoodsend

unread,
Jun 22, 2020, 9:43:56 AM6/22/20
to PyInstaller

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.

Itsik Weissman

unread,
Jun 23, 2020, 6:50:50 AM6/23/20
to pyins...@googlegroups.com
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
 
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
--
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 pyinstaller...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/fdc99e58-97a1-4da1-a19f-1067f76dc768n%40googlegroups.com.
image[3].png

bwoodsend

unread,
Jun 23, 2020, 11:25:19 AM6/23/20
to PyInstaller

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

Chris Barker

unread,
Jun 24, 2020, 3:22:21 AM6/24/20
to pyins...@googlegroups.com
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


--

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

Chris....@noaa.gov

Itsik Weissman

unread,
Jun 24, 2020, 4:01:39 AM6/24/20
to pyins...@googlegroups.com
Brénainn,
Thank you very much for the valuable information. I will try your tips.
Unfortunately, I am not able to reproduce the scipy interpolate module error. So I cannot provide any more details.
I tried to import the second package that I am using: ‘from skimage.transform import warp’. This script runs smoothly on my Python interpreter:
image
However, pyinstaller failed to compile it:
image
The anaconda pyinstaller (ipyinstaller?) accomplished the task gracefully.
I am trying to develop a commercial software package. I feel quite confident with the scripting phase, but I see that I need help with the compilation. I wonder, is there anybody here who can help me with the compilation process as a freelancer?
image[3].png
image[5].png

bwoodsend

unread,
Jun 26, 2020, 2:53:06 AM6/26/20
to PyInstaller

Thanks Chris for sharing that. It’s been a while since I used Anaconda.

Itsik, I tried from skimage.transform import warp’ on my plain Python and it’s worked fine. Could you give us the full traceback rather than a screenshot. If you find copying awkward in cmd you can pipe stderr to a file by appending > errors.txt 2>&1 to your command.

Freelancing does happen on here occasionally. You can post another question called Bounty $100 - please fix my PyInstaller program for me or something and you’ll probably get someone. Although we’d rather fix the problem permanently for everyone by either patching PyInstaller or writing a hook for a particular troublesome package. Then, if you’ve got cash you’re willing to throw around, the PyInstaller core team are always desperate for funding.

Yitzhak Weissman

unread,
Jul 4, 2020, 2:05:56 PM7/4/20
to PyInstaller
Brénainn,
Thank you again for your continuing support. I attach the PyInstaller log for my script: 'from skimage.transform import warp'.
Actually, I have already researched this problem and found others who encountered it too. A few workarounds were suggested, but all look complicated and none guaranteed to work. Anyway, I do not have the tools to edit spec files.
As I said, the Anaconda pyinstaller worked well with this script.

skimagetest_log.txt

its...@gmail.com

unread,
Jul 6, 2020, 3:39:07 AM7/6/20
to pyins...@googlegroups.com
Some time has passed, and the problem is now solved. I found out how to edit the spec file, and increased the iteration limit. I apologize for distracting this community with a rookie problems.
 
Sent: Monday, June 29, 2020 2:11 PM
Subject: [PyInstaller] skimage test
 
--
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 pyinstaller...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages