0

My system is Win 10, 64 bit. python 2.7

I install shapely with below commands, and it works well with Win 10.

conda config --add channels conda-forge 
conda install shapely

Then I used pyinstaller to generate an executable for others to use my app, so they don't need to set up any environment.

This executable also work well on Win 10, however it crashed on win 7. For this line,

 from shapely import geometry

On win7, the error message is

OSError: Could not find lib geos_c.dll or load any of its variants [].

I am sure it is caused by shapely, before I used shapely, this exe generated by pyinstaller can work correctly on both win 10 (64 bit) and win 7 (64bit).

So I am wondering whether win 10 and win 7 need different versions of shapely. Is there a way I can make shapely work properly with just 1 executable, otherwise I need to prepare another PC with win 7 and also not convenient for the exe receiver.


New findings:

  1. In both win 10 and win 7, under anaconda directory, geos_c.dll is same in win 7 and win 10. Then I copied this geos_c.dll directly to the package generated by pyinstaller under win 10, the exe could work in both win 7 and win 10.

  2. the geos_c.dll generated by pyinstaller under win 10 is larger than original one under anaconda. this package only work in win 10.

  3. the geos_c.dll generated by pyinstaller under win 7 is larger than original one under anaconda. And geos_c.dll is different from the one generated by pyinstaller under win 10, but the size is same. The exe can work in both win 7 and win 10.

So I am think what pyinstaller add to geos_c.dll compared with the original one.

Georgy
  • 12,464
  • 7
  • 65
  • 73
Jack
  • 27
  • 5
  • Usually you create the executable on Windows7 and you can run it on newer Windows versions. – Maurice Meyer Oct 26 '17 at 08:32
  • What is the exact error? What command are using to build with pyinstaller? – The4thIceman Oct 26 '17 at 10:03
  • This is the error message, OSError: Could not find lib geos_c.dll or load any of its variants []. But this geos_c.dll does exist in the package, probably the content of this dll is not compatible with win 7? The command I use is like pyinstaller main.py – Jack Oct 26 '17 at 21:19

0 Answers0