Could not start application on Heroka using Flask and Shapely

I developed a small application that requires the Shapely python library. I installed it in windows via the .exe file so that it automatically puts the necessary DLL files (geos.dll, geos_c.dll) into Python27 \ Lib \ site-packages \ shapely \ DLL.

When I tried to create virtualenv on my box, I installed a slender one via pip, but it did not put these dll files, and therefore I got this error:

from shapely.geos import lgeos File "...\lib\site-packages\shapely\geos.py", line 71, in <module> _lgeos = CDLL("geos.dll") File "C:\Python27\Lib\ctypes\__init__.py", line 353, in __init__ self._handle = _dlopen(self._name, mode) WindowsError: [Error 126] The specified module could not be found 

So, I manually replace these 2 DLL files in the virtualenv \ Lib \ site-packages \ shapely \ DLLs folder, and it worked.

Now I'm trying to deploy the application on heroku, but again it failed due to the following error:

 from shapely.geos import lgeos _lgeos = load_dll('geos_c', fallbacks=['libgeos_c.so.1', 'libgeos_c.so']) file "/app/.heroku/python/lib/python2.7/site-packages/shapely/geos.py", line 44, in load_dll from shapely.coords import required file "/app/.heroku/python/lib/python2.7/site-packages/shapely/geos.py", line 47, in <module> libname, fallbacks or [])) Error: Could not find library geos_c or load any of its variants ['libgeos_c.so.1', 'libgeos_c.so'] Process exited with status 1 State changed from starting to crashed 

So, I accepted it crashed due to these two dll files that were not there. I copied these 2 files in a separate folder and clicked them through git

I made a .profile file in the root of my application to copy these 2 files into python environment.

.profile

 #Copy Shapely DLL Files to Site packages cp -r $HOME/env_files/DLLs $HOME/.heroku/python/lib/python2.7/site-packages/shapely/ 

but still the application crashes with the same error.

Can anyone help me with this?

+4
source share
1 answer

Heroku use * nix system - works with * .so libraries, not * .dll.

Thus, remove any ENV-vars and dll.

I install via pip

 pip install shapely 

install from github failed

0
source

All Articles