Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pygeos installation doesn't work with python 3.11 #457

Closed
Aniwax opened this issue Oct 26, 2022 · 5 comments
Closed

Pygeos installation doesn't work with python 3.11 #457

Aniwax opened this issue Oct 26, 2022 · 5 comments

Comments

@Aniwax
Copy link

Aniwax commented Oct 26, 2022

pip install pygeos didn't work with python 11 on Windows.
I tried pygeos version 0.10, 0.12, 0.13, all didn't work.

Here is the error message

(ibrusenv) PS C:\Users\aniwax\Documents\GitHub\iBrusCoreSim> pip install pygeos==0.12
Collecting pygeos==0.12
  Downloading pygeos-0.12.0.tar.gz (141 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 141.4/141.4 kB 8.2 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: numpy>=1.13 in c:\users\aniwax\documents\github\ibruscoresim\ibrusenv\lib\site-packa
(from pygeos==0.12) (1.23.4)
Building wheels for collected packages: pygeos
  Building wheel for pygeos (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for pygeos (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [65 lines of output]
      Could not find geos-config executable. Either append the path to geos-config to PATH or manually provide the ude_dirs, library_dirs, libraries and other link args for compiling against a GEOS version >=3.5.
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-cpython-311
      creating build\lib.win-amd64-cpython-311\pygeos
      copying pygeos\constructive.py -> build\lib.win-amd64-cpython-311\pygeos
      copying pygeos\coordinates.py -> build\lib.win-amd64-cpython-311\pygeos
      copying pygeos\creation.py -> build\lib.win-amd64-cpython-311\pygeos
      copying pygeos\decorators.py -> build\lib.win-amd64-cpython-311\pygeos
      copying pygeos\enum.py -> build\lib.win-amd64-cpython-311\pygeos
      copying pygeos\geometry.py -> build\lib.win-amd64-cpython-311\pygeos
      copying pygeos\io.py -> build\lib.win-amd64-cpython-311\pygeos
      copying pygeos\linear.py -> build\lib.win-amd64-cpython-311\pygeos
      copying pygeos\measurement.py -> build\lib.win-amd64-cpython-311\pygeos
      copying pygeos\predicates.py -> build\lib.win-amd64-cpython-311\pygeos
      copying pygeos\set_operations.py -> build\lib.win-amd64-cpython-311\pygeos
      copying pygeos\strtree.py -> build\lib.win-amd64-cpython-311\pygeos
      copying pygeos\testing.py -> build\lib.win-amd64-cpython-311\pygeos
      copying pygeos\_version.py -> build\lib.win-amd64-cpython-311\pygeos
      copying pygeos\__init__.py -> build\lib.win-amd64-cpython-311\pygeos
      creating build\lib.win-amd64-cpython-311\pygeos\tests
      copying pygeos\tests\common.py -> build\lib.win-amd64-cpython-311\pygeos\tests
      copying pygeos\tests\test_constructive.py -> build\lib.win-amd64-cpython-311\pygeos\tests
      copying pygeos\tests\test_coordinates.py -> build\lib.win-amd64-cpython-311\pygeos\tests
      copying pygeos\tests\test_creation.py -> build\lib.win-amd64-cpython-311\pygeos\tests
      copying pygeos\tests\test_creation_indices.py -> build\lib.win-amd64-cpython-311\pygeos\tests
      copying pygeos\tests\test_geometry.py -> build\lib.win-amd64-cpython-311\pygeos\tests
      copying pygeos\tests\test_io.py -> build\lib.win-amd64-cpython-311\pygeos\tests
      copying pygeos\tests\test_linear.py -> build\lib.win-amd64-cpython-311\pygeos\tests
      copying pygeos\tests\test_measurement.py -> build\lib.win-amd64-cpython-311\pygeos\tests
      copying pygeos\tests\test_misc.py -> build\lib.win-amd64-cpython-311\pygeos\tests
      copying pygeos\tests\test_predicates.py -> build\lib.win-amd64-cpython-311\pygeos\tests
      copying pygeos\tests\test_set_operations.py -> build\lib.win-amd64-cpython-311\pygeos\tests
      copying pygeos\tests\test_strtree.py -> build\lib.win-amd64-cpython-311\pygeos\tests
      copying pygeos\tests\test_testing.py -> build\lib.win-amd64-cpython-311\pygeos\tests
      copying pygeos\tests\__init__.py -> build\lib.win-amd64-cpython-311\pygeos\tests
      running egg_info
      writing pygeos.egg-info\PKG-INFO
      writing dependency_links to pygeos.egg-info\dependency_links.txt
      writing requirements to pygeos.egg-info\requires.txt
      writing top-level names to pygeos.egg-info\top_level.txt
      reading manifest file 'pygeos.egg-info\SOURCES.txt'
      adding license file 'LICENSE'
      writing manifest file 'pygeos.egg-info\SOURCES.txt'
      copying pygeos\_geometry.c -> build\lib.win-amd64-cpython-311\pygeos
      copying pygeos\_geometry.pyx -> build\lib.win-amd64-cpython-311\pygeos
      copying pygeos\_geos.c -> build\lib.win-amd64-cpython-311\pygeos
      copying pygeos\_geos.pxd -> build\lib.win-amd64-cpython-311\pygeos
      copying pygeos\_geos.pyx -> build\lib.win-amd64-cpython-311\pygeos
      copying pygeos\_pygeos_api.pxd -> build\lib.win-amd64-cpython-311\pygeos
      UPDATING build\lib.win-amd64-cpython-311\pygeos/_version.py
      set build\lib.win-amd64-cpython-311\pygeos/_version.py to '0.12.0'
      running build_ext
      building 'pygeos.lib' extension
      creating build\temp.win-amd64-cpython-311
      creating build\temp.win-amd64-cpython-311\Release
      creating build\temp.win-amd64-cpython-311\Release\src
      "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.28.29910\bin\HostX86\x64\cl. /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\Users\aniwax\Documents\GitHub\iBrusCoreSim\ibrusenv\include -IC:\Users\an\AppData\Local\Programs\Python\Python311\include -IC:\Users\aniwax\AppData\Local\Programs\Python\Python311\Include \Users\aniwax\AppData\Local\Temp\pip-build-env-qbniyqoa\overlay\Lib\site-packages\numpy\core\include "-IC:\Program s (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.28.29910\ATLMFC\include" "-IC:\Program Files (x86)rosoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.28.29910\include" "-IC:\Program Files (x86)\Windows Kits\10\ide\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (xWindows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-ICogram Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" /Tcsrc/c_api.c /Fobuild\temp.win-amd64-cpython-311ease\src/c_api.obj
      c_api.c
      C:\Users\aniwax\AppData\Local\Temp\pip-install-_1zaabxl\pygeos_d9dff3765b834eccab5867e3e841624b\src\geos.h(13arning C4068: unknown pragma 'GCC'
      C:\Users\aniwax\AppData\Local\Temp\pip-install-_1zaabxl\pygeos_d9dff3765b834eccab5867e3e841624b\src\geos.h(14arning C4068: unknown pragma 'GCC'
      C:\Users\aniwax\AppData\Local\Temp\pip-install-_1zaabxl\pygeos_d9dff3765b834eccab5867e3e841624b\src\geos.h(15atal error C1083: Cannot open include file: 'geos_c.h': No such file or directory
      error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\VC\\Tools\\MSVC\\14.28.29\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pygeos
Failed to build pygeos
ERROR: Could not build wheels for pygeos, which is required to install pyproject.toml-based projects
@Aniwax
Copy link
Author

Aniwax commented Oct 26, 2022

Is the solution similar to this issue, #358 ?


This solution didn't work for me atm. I set GEOS_INCLUDE_PATH == ./OSGEO4W/include, GEOS_LIBRARY_PATH==./OSGEO4W/lib or GEOS_INCLUDE_PATH == ./OSGEO4W/include, GEOS_LIBRARY_PATH==./OSGEO4W/bin

both solution worked for installation. But then when I run a simulation, I get error from pygeos/__init__.py that
from .lib import GEOS_EXCEPTION, dll couldn't find the corresponding file. So I guess this means the path setting was not correct.


from .lib import GEOSException # NOQA ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ImportError: DLL load failed while importing lib: The specified module could not be found.

@Erotemic
Copy link

Erotemic commented Dec 3, 2022

Any updates on when pygeos wheels for 3.11 will be released?

@caspervdw
Copy link
Member

Sorry for the late reply, there is now a PR up over here: #458

@caspervdw
Copy link
Member

@Aniwax @Erotemic Version 0.14 release has started, it should be up (with Py3.11 wheels) within an hour.

@jorisvandenbossche
Copy link
Member

@caspervdw thanks for the release!

shaneahmed added a commit to TissueImageAnalytics/tiatoolbox that referenced this issue May 5, 2023
Adds support for Python 3.11 (beta)

- [x] Add 3.11 to the GitHub Actions CI workflow.
- [x] Add 3.11 to setup.py
- [x] Update pip install workflow.
- [x] Update conda requirements python versions.


Waiting on some dependencies to update:

- [x] Shapely (closed) shapely/shapely#1584
  - PyGeos pygeos/pygeos#457
- [x] PyTorch pytorch/pytorch#86566 
    - [x] PyTorch 2.0 supports Python 3.11 
    - [ ] `torch.compile` is not fully supported yet.
- [x] Scipy 1.9.2 not supported by Scikit-image scikit-image/scikit-image#6773
- [x] numba numba/numba#8304 support https://github.com/numba/numba/milestone/63
  - [x] numba/numba#8841
- [x] OpenSlide support for Python 3.11 openslide/openslide-python#189 
  - [ ] openslide/openslide-python#188

---------

Co-authored-by: Shan E Ahmed Raza <13048456+shaneahmed@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants