Thanks for the heads up @expeditioneer. I scanned the build output in the Gentoo PR and it looks like this is largely an issue between Cython and Python 3.9.
Currently requirements-dev.txt specifies cython==0.29.14
, which could cause issues with newer versions of Python (e.g. scan this for "3.9")
Inevitably, we'll need to add 3.9-dev
to the CI test matrix.
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\austi\AppData\Local\Temp\pip-install-d8c90ger\shapely\setup.py", line 85, in <module>
from shapely._buildcfg import geos_version_string, geos_version, \
File "C:\Users\austi\AppData\Local\Temp\pip-install-d8c90ger\shapely\shapely\_buildcfg.py", line 205, in <module>
lgeos = CDLL("geos_c.dll")
File "C:\Python\lib\ctypes\__init__.py", line 374, in __init__
self._handle = _dlopen(self._name, mode)
FileNotFoundError: Could not find module 'geos_c.dll' (or one of its dependencies). Try using the full path with
constructor syntax.
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Getting this error when I do pip install shapely
on windows 10 & python 3.9.0
Someone suggested installing the installer from https://trac.osgeo.org/osgeo4w/
which didn't work either (I assume that was outdated/for a different issue). Is there a current workaround for 3.9?
@austinulfers we don't have wheels for Windows and 3.9 on PyPI and no time frame for doing it yet. I'm not sure whether its only a matter of extending our AppVeyor builds here https://github.com/Toblerity/Shapely/blob/maint-1.7/appveyor.yml#L40 or whether its more involved.
Currently it's still too early for Python 3.9 support, i.e. the upper limit for AppVeyor and Travis CI is still Python 3.8. However, when these CI platforms support Python 3.9, then we could consider a 1.7.2 release.
I just did a quick check with Python 3.9.0 via conda-forge, and all tests pass without issue, so it should be straight-forward to support Python 3.9 when the upstream components are ready.
Both TravisCI and AppVeyor are now showing support for python 3.9.
I have exactly the same problem. But I really would need a working build install for pyrosm installation. So any idea for that is appreciated
I think there is a work around for an install and that is as far as i can see to install a wheel from here:
https://www.lfd.uci.edu/~gohlke/pythonlibs/#shapely
according to
https://geoffboeing.com/2014/09/using-geopandas-windows/
and then copying accross the two dlls generated by https://github.com/pygeos/pygeos-wheels/blob/master/scripts/build_geos.cmd to dll folder
Userprofile\AppData\Local\Programs\Python\Python39\Lib\site-packages\shapely\DLLs
(i activated build environment in Visual studio 2019 via C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build> vcvars64.bat and then run the batch inside that environment after setting
set GEOSINSTALL=E:\GEOS-DLL
set GEOS_VERSION=3.8.1)
I just crosschecked and copying the dlls to the shapely dll folder worked, overwriting the old dll. You also then get same versions for pygeos and shapely. build of pygeos with a built geos from above script works fine as it should, when using the two environment variables, e.g.
GEOS_INCLUDE_PATH=E:\GEOS-DLL\include
geos_library_path=E:\GEOS-DLL\bin
I suspect the error relates maybe to two dlls being built (c and c++) where geos_c.dll depends on geos.dll ( I inspected dependencies with a windows tool) but during setup only one of those is copied to the dll folder ??? environment variable geos_library_path and also the catch method in line 205 1.71 _buildcfg.py do not work. No idea exactly why because pygeos (build) install works fine
So this issue in windows does not probably only relate to python 3.9 or there were some changes to CDLL that were difficult for shapely but not for pygeos.
I guess a similar methodology to load the dlls as in pygeos should work for 3.9. But I dont understand the differences between those two
Very surprising is that once the 2 build script dlls are copied accross to the shapely dll folder there is no issue in loading the dll during "import shapely" in python ... which is not particularly logical
Traceback (most recent call last): File "<string>", line 1, in <module> File "C:\Users\austi\AppData\Local\Temp\pip-install-d8c90ger\shapely\setup.py", line 85, in <module> from shapely._buildcfg import geos_version_string, geos_version, \ File "C:\Users\austi\AppData\Local\Temp\pip-install-d8c90ger\shapely\shapely\_buildcfg.py", line 205, in <module> lgeos = CDLL("geos_c.dll") File "C:\Python\lib\ctypes\__init__.py", line 374, in __init__ self._handle = _dlopen(self._name, mode) FileNotFoundError: Could not find module 'geos_c.dll' (or one of its dependencies). Try using the full path with constructor syntax. ---------------------------------------- ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Getting this error when I do
pip install shapely
on windows 10 & python 3.9.0Someone suggested installing the installer from
https://trac.osgeo.org/osgeo4w/
which didn't work either (I assume that was outdated/for a different issue). Is there a current workaround for 3.9?
Python 3.9 support on Windows should be available soon (pending availability of @sgillies). If anyone is really keen to be a beta tester, download one of these (from AppVeyor's build from https://github.com/shapely/shapely-wheels/pull/6):
then from a non-conda Python 3.8 console, do something like this:
pip install --upgrade C:\Users\someone\Downloads\Shapely-1.7b1-cp39-cp39-win_amd64.whl
@mwtoews Thx :-) so shapely has this same build script, too :-) so big credits for all the people that were actually involved in that.
Ill test the amd64 version by using it :-)
Wheels for Windows and Python 3.9 are on PyPI now: https://pypi.org/project/Shapely/1.7.1/#files.
Were wheels for Linux and OSX planned under this issue as well?
Most helpful comment
Were wheels for Linux and OSX planned under this issue as well?