Shapely: vektorisiert auf Python 3.8

Erstellt am 21. Dez. 2019  ·  6Kommentare  ·  Quelle: Toblerity/Shapely

Es sieht so aus, als ob from shapely import vectorized unter Python 3.8 fehlschlägt, wenn Shapely über pip installiert wird:

    from shapely import vectorized
>   from ._vectorized import (contains, touches)
E   ModuleNotFoundError: No module named 'shapely.vectorized._vectorized'

https://travis-ci.org/mikedh/trimesh/jobs/627984786#L1423 -L1426
Ich habe auch einige "in the wild"-Berichte darüber gesehen, bin mir aber nicht sicher, auf welchem ​​​​Python sie waren:
https://github.com/mikedh/trimesh/issues/667

Hilfreichster Kommentar

Danke, dass du das aufgespürt hast! Yup sieht so aus, als ob 1.7a2 den Trick macht .

Irgendwie seltsam, dass es reproduzierbar war, selbst wenn es aus einem Klon des Repositorys erstellt wurde, vielleicht fehlten die Geos-Header oder so? Fühlen Sie sich frei, zu schließen, oder wir können warten, bis die Veröffentlichung geschlossen ist.

Für andere Leute, die die Vorabversion möchten, können Sie sie mit installieren:
pip install shapely==1.7a2

Alle 6 Kommentare

@mikedh versuchen Sie, eine formschöne Installation in einer Conda-Umgebung zu installieren? Einen Hinweis dazu sehe ich unter https://travis-ci.org/mikedh/trimesh/jobs/627984786#L1048. Während dies für reine Python-Pakete funktionieren kann, kann dies nicht für Pakete funktionieren, die Erweiterungsmodule enthalten, wie dies bei Shapely der Fall ist. Sie können die formschönen Räder von PyPI einfach nicht in einer Conda-Umgebung installieren, Sie müssen aus einem Conda-Kanal wie Conda-Forge formschön werden.

Ja, pip install in Conda Python ist etwas seltsam, aber ich denke, das Problem liegt woanders und ist auf Mainline-Python reproduzierbar. Hier ist ein minimal reproduzierendes Dockerfile:

FROM python:3.8-slim-buster
RUN apt-get update; apt-get install -y libgeos-dev
RUN pip install numpy shapely
RUN python -c "from shapely import vectorized"

Scheitert mit:

Step 4/4 : RUN python -c "from shapely import vectorized"
 ---> Running in 9f5d06d595d1
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python3.8/site-packages/shapely/vectorized/__init__.py", line 3, in <module>
    from ._vectorized import (contains, touches)
ModuleNotFoundError: No module named 'shapely.vectorized._vectorized'
The command '/bin/sh -c python -c "from shapely import vectorized"' returned a non-zero code: 1

Habe ein wenig debuggen und ein paar Dinge ausprobiert, von denen nichts funktioniert hat. Als Referenz ist hier ein etwas nützlicheres Dockerfile:

FROM python:3.8-slim-buster
RUN apt-get update; apt-get install -y  --no-install-recommends git libgeos-dev
RUN pip install numpy cython
# COPY Shapely Shapely
RUN git clone https://github.com/Toblerity/Shapely.git
RUN cd Shapely; python setup.py install
RUN python -c "from shapely import vectorized"

Und die volle Ausgabe der formschönen Bauschritte:

Step 4/6 : RUN git clone https://github.com/Toblerity/Shapely.git
 ---> Running in 89f7b2d15e03
Cloning into 'Shapely'...
 ---> e587d161685e
Removing intermediate container 89f7b2d15e03
Step 5/6 : RUN cd Shapely; python setup.py install
 ---> Running in 4e118ceb8e71
/usr/local/lib/python3.8/site-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /Shapely/shapely/speedups/_speedups.pyx
  tree = Parsing.p_module(s, pxd, full_module_name)
running install
running bdist_egg
running egg_info
creating Shapely.egg-info
writing Shapely.egg-info/PKG-INFO
writing dependency_links to Shapely.egg-info/dependency_links.txt
writing requirements to Shapely.egg-info/requires.txt
writing top-level names to Shapely.egg-info/top_level.txt
writing manifest file 'Shapely.egg-info/SOURCES.txt'
reading manifest file 'Shapely.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
no previously-included directories found matching 'manual'
no previously-included directories found matching 'debian'
no previously-included directories found matching 'docs'
no previously-included directories found matching 'DLLs_AMD64'
no previously-included directories found matching 'DLLs_x86'
warning: no previously-included files found matching '*.txt'
warning: no files found matching '*.dll' under directory 'shapely/DLLs'
warning: no files found matching '*.rst' under directory 'shapely/DLLs'
warning: no files found matching '*.txt' under directory 'shapely/DLLs'
writing manifest file 'Shapely.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
creating build
creating build/lib.linux-x86_64-3.8
creating build/lib.linux-x86_64-3.8/shapely
copying shapely/iterops.py -> build/lib.linux-x86_64-3.8/shapely
copying shapely/validation.py -> build/lib.linux-x86_64-3.8/shapely
copying shapely/wkb.py -> build/lib.linux-x86_64-3.8/shapely
copying shapely/_buildcfg.py -> build/lib.linux-x86_64-3.8/shapely
copying shapely/geos.py -> build/lib.linux-x86_64-3.8/shapely
copying shapely/topology.py -> build/lib.linux-x86_64-3.8/shapely
copying shapely/affinity.py -> build/lib.linux-x86_64-3.8/shapely
copying shapely/wkt.py -> build/lib.linux-x86_64-3.8/shapely
copying shapely/predicates.py -> build/lib.linux-x86_64-3.8/shapely
copying shapely/prepared.py -> build/lib.linux-x86_64-3.8/shapely
copying shapely/strtree.py -> build/lib.linux-x86_64-3.8/shapely
copying shapely/coords.py -> build/lib.linux-x86_64-3.8/shapely
copying shapely/errors.py -> build/lib.linux-x86_64-3.8/shapely
copying shapely/linref.py -> build/lib.linux-x86_64-3.8/shapely
copying shapely/__init__.py -> build/lib.linux-x86_64-3.8/shapely
copying shapely/ctypes_declarations.py -> build/lib.linux-x86_64-3.8/shapely
copying shapely/impl.py -> build/lib.linux-x86_64-3.8/shapely
copying shapely/ops.py -> build/lib.linux-x86_64-3.8/shapely
creating build/lib.linux-x86_64-3.8/shapely/geometry
copying shapely/geometry/multilinestring.py -> build/lib.linux-x86_64-3.8/shapely/geometry
copying shapely/geometry/multipoint.py -> build/lib.linux-x86_64-3.8/shapely/geometry
copying shapely/geometry/linestring.py -> build/lib.linux-x86_64-3.8/shapely/geometry
copying shapely/geometry/collection.py -> build/lib.linux-x86_64-3.8/shapely/geometry
copying shapely/geometry/polygon.py -> build/lib.linux-x86_64-3.8/shapely/geometry
copying shapely/geometry/point.py -> build/lib.linux-x86_64-3.8/shapely/geometry
copying shapely/geometry/multipolygon.py -> build/lib.linux-x86_64-3.8/shapely/geometry
copying shapely/geometry/geo.py -> build/lib.linux-x86_64-3.8/shapely/geometry
copying shapely/geometry/proxy.py -> build/lib.linux-x86_64-3.8/shapely/geometry
copying shapely/geometry/__init__.py -> build/lib.linux-x86_64-3.8/shapely/geometry
copying shapely/geometry/base.py -> build/lib.linux-x86_64-3.8/shapely/geometry
creating build/lib.linux-x86_64-3.8/shapely/algorithms
copying shapely/algorithms/cga.py -> build/lib.linux-x86_64-3.8/shapely/algorithms
copying shapely/algorithms/__init__.py -> build/lib.linux-x86_64-3.8/shapely/algorithms
copying shapely/algorithms/polylabel.py -> build/lib.linux-x86_64-3.8/shapely/algorithms
creating build/lib.linux-x86_64-3.8/shapely/examples
copying shapely/examples/dissolve.py -> build/lib.linux-x86_64-3.8/shapely/examples
copying shapely/examples/geoms.py -> build/lib.linux-x86_64-3.8/shapely/examples
copying shapely/examples/intersect.py -> build/lib.linux-x86_64-3.8/shapely/examples
copying shapely/examples/__init__.py -> build/lib.linux-x86_64-3.8/shapely/examples
creating build/lib.linux-x86_64-3.8/shapely/speedups
copying shapely/speedups/__init__.py -> build/lib.linux-x86_64-3.8/shapely/speedups
creating build/lib.linux-x86_64-3.8/shapely/vectorized
copying shapely/vectorized/__init__.py -> build/lib.linux-x86_64-3.8/shapely/vectorized
copying shapely/_geos.pxi -> build/lib.linux-x86_64-3.8/shapely
copying shapely/speedups/_speedups.c -> build/lib.linux-x86_64-3.8/shapely/speedups
copying shapely/speedups/_speedups.pyx -> build/lib.linux-x86_64-3.8/shapely/speedups
copying shapely/vectorized/_vectorized.pyx -> build/lib.linux-x86_64-3.8/shapely/vectorized
running build_ext
cythoning shapely/vectorized/_vectorized.pyx to shapely/vectorized/_vectorized.c
building 'shapely.speedups._speedups' extension
creating build/temp.linux-x86_64-3.8
creating build/temp.linux-x86_64-3.8/shapely
creating build/temp.linux-x86_64-3.8/shapely/speedups
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/include -I/usr/local/lib/python3.8/site-packages/numpy/core/include -I/usr/local/include/python3.8 -c shapely/speedups/_speedups.c -o build/temp.linux-x86_64-3.8/shapely/speedups/_speedups.o
/usr/local/lib/python3.8/site-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /Shapely/shapely/vectorized/_vectorized.pyx
  tree = Parsing.p_module(s, pxd, full_module_name)
setup.py:387: DeprecationWarning: The 'warn' method is deprecated, use 'warning' instead
  log.warn(ex)
WARNING:setup.py:command 'gcc' failed with exit status 1
setup.py:388: DeprecationWarning: The 'warn' method is deprecated, use 'warning' instead
  log.warn(BUILD_EXT_WARNING)
WARNING:setup.py:The C extension could not be compiled, speedups are not enabled.
setup.py:389: DeprecationWarning: The 'warn' method is deprecated, use 'warning' instead
  log.warn("Failure information, if any, is above.")
WARNING:setup.py:Failure information, if any, is above.
setup.py:390: DeprecationWarning: The 'warn' method is deprecated, use 'warning' instead
  log.warn("I'm retrying the build without the C extension now.")
WARNING:setup.py:I'm retrying the build without the C extension now.
running install
running bdist_egg
running egg_info
writing Shapely.egg-info/PKG-INFO
writing dependency_links to Shapely.egg-info/dependency_links.txt
writing requirements to Shapely.egg-info/requires.txt
writing top-level names to Shapely.egg-info/top_level.txt
reading manifest file 'Shapely.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
no previously-included directories found matching 'manual'
no previously-included directories found matching 'debian'
no previously-included directories found matching 'DLLs_AMD64'
no previously-included directories found matching 'DLLs_x86'
warning: no files found matching '*.dll' under directory 'shapely/DLLs'
warning: no files found matching '*.rst' under directory 'shapely/DLLs'
warning: no files found matching '*.txt' under directory 'shapely/DLLs'
writing manifest file 'Shapely.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
creating build/lib
creating build/lib/shapely
copying shapely/iterops.py -> build/lib/shapely
copying shapely/validation.py -> build/lib/shapely
copying shapely/wkb.py -> build/lib/shapely
copying shapely/_buildcfg.py -> build/lib/shapely
copying shapely/geos.py -> build/lib/shapely
copying shapely/topology.py -> build/lib/shapely
copying shapely/affinity.py -> build/lib/shapely
copying shapely/wkt.py -> build/lib/shapely
copying shapely/predicates.py -> build/lib/shapely
copying shapely/prepared.py -> build/lib/shapely
copying shapely/strtree.py -> build/lib/shapely
copying shapely/coords.py -> build/lib/shapely
copying shapely/errors.py -> build/lib/shapely
copying shapely/linref.py -> build/lib/shapely
copying shapely/__init__.py -> build/lib/shapely
copying shapely/ctypes_declarations.py -> build/lib/shapely
copying shapely/impl.py -> build/lib/shapely
copying shapely/ops.py -> build/lib/shapely
creating build/lib/shapely/geometry
copying shapely/geometry/multilinestring.py -> build/lib/shapely/geometry
copying shapely/geometry/multipoint.py -> build/lib/shapely/geometry
copying shapely/geometry/linestring.py -> build/lib/shapely/geometry
copying shapely/geometry/collection.py -> build/lib/shapely/geometry
copying shapely/geometry/polygon.py -> build/lib/shapely/geometry
copying shapely/geometry/point.py -> build/lib/shapely/geometry
copying shapely/geometry/multipolygon.py -> build/lib/shapely/geometry
copying shapely/geometry/geo.py -> build/lib/shapely/geometry
copying shapely/geometry/proxy.py -> build/lib/shapely/geometry
copying shapely/geometry/__init__.py -> build/lib/shapely/geometry
copying shapely/geometry/base.py -> build/lib/shapely/geometry
creating build/lib/shapely/algorithms
copying shapely/algorithms/cga.py -> build/lib/shapely/algorithms
copying shapely/algorithms/__init__.py -> build/lib/shapely/algorithms
copying shapely/algorithms/polylabel.py -> build/lib/shapely/algorithms
creating build/lib/shapely/examples
copying shapely/examples/dissolve.py -> build/lib/shapely/examples
copying shapely/examples/geoms.py -> build/lib/shapely/examples
copying shapely/examples/intersect.py -> build/lib/shapely/examples
copying shapely/examples/__init__.py -> build/lib/shapely/examples
creating build/lib/shapely/speedups
copying shapely/speedups/__init__.py -> build/lib/shapely/speedups
creating build/lib/shapely/vectorized
copying shapely/vectorized/__init__.py -> build/lib/shapely/vectorized
copying shapely/_geos.pxi -> build/lib/shapely
copying shapely/speedups/_speedups.c -> build/lib/shapely/speedups
copying shapely/speedups/_speedups.pyx -> build/lib/shapely/speedups
copying shapely/vectorized/_vectorized.pyx -> build/lib/shapely/vectorized
creating build/bdist.linux-x86_64
creating build/bdist.linux-x86_64/egg
creating build/bdist.linux-x86_64/egg/shapely
copying build/lib/shapely/iterops.py -> build/bdist.linux-x86_64/egg/shapely
copying build/lib/shapely/validation.py -> build/bdist.linux-x86_64/egg/shapely
copying build/lib/shapely/wkb.py -> build/bdist.linux-x86_64/egg/shapely
copying build/lib/shapely/_buildcfg.py -> build/bdist.linux-x86_64/egg/shapely
copying build/lib/shapely/geos.py -> build/bdist.linux-x86_64/egg/shapely
copying build/lib/shapely/topology.py -> build/bdist.linux-x86_64/egg/shapely
copying build/lib/shapely/affinity.py -> build/bdist.linux-x86_64/egg/shapely
copying build/lib/shapely/wkt.py -> build/bdist.linux-x86_64/egg/shapely
copying build/lib/shapely/predicates.py -> build/bdist.linux-x86_64/egg/shapely
creating build/bdist.linux-x86_64/egg/shapely/algorithms
copying build/lib/shapely/algorithms/cga.py -> build/bdist.linux-x86_64/egg/shapely/algorithms
copying build/lib/shapely/algorithms/__init__.py -> build/bdist.linux-x86_64/egg/shapely/algorithms
copying build/lib/shapely/algorithms/polylabel.py -> build/bdist.linux-x86_64/egg/shapely/algorithms
creating build/bdist.linux-x86_64/egg/shapely/speedups
copying build/lib/shapely/speedups/_speedups.pyx -> build/bdist.linux-x86_64/egg/shapely/speedups
copying build/lib/shapely/speedups/_speedups.c -> build/bdist.linux-x86_64/egg/shapely/speedups
copying build/lib/shapely/speedups/__init__.py -> build/bdist.linux-x86_64/egg/shapely/speedups
copying build/lib/shapely/prepared.py -> build/bdist.linux-x86_64/egg/shapely
copying build/lib/shapely/strtree.py -> build/bdist.linux-x86_64/egg/shapely
creating build/bdist.linux-x86_64/egg/shapely/examples
copying build/lib/shapely/examples/dissolve.py -> build/bdist.linux-x86_64/egg/shapely/examples
copying build/lib/shapely/examples/geoms.py -> build/bdist.linux-x86_64/egg/shapely/examples
copying build/lib/shapely/examples/intersect.py -> build/bdist.linux-x86_64/egg/shapely/examples
copying build/lib/shapely/examples/__init__.py -> build/bdist.linux-x86_64/egg/shapely/examples
copying build/lib/shapely/coords.py -> build/bdist.linux-x86_64/egg/shapely
copying build/lib/shapely/errors.py -> build/bdist.linux-x86_64/egg/shapely
creating build/bdist.linux-x86_64/egg/shapely/geometry
copying build/lib/shapely/geometry/multilinestring.py -> build/bdist.linux-x86_64/egg/shapely/geometry
copying build/lib/shapely/geometry/multipoint.py -> build/bdist.linux-x86_64/egg/shapely/geometry
copying build/lib/shapely/geometry/linestring.py -> build/bdist.linux-x86_64/egg/shapely/geometry
copying build/lib/shapely/geometry/collection.py -> build/bdist.linux-x86_64/egg/shapely/geometry
copying build/lib/shapely/geometry/polygon.py -> build/bdist.linux-x86_64/egg/shapely/geometry
copying build/lib/shapely/geometry/point.py -> build/bdist.linux-x86_64/egg/shapely/geometry
copying build/lib/shapely/geometry/multipolygon.py -> build/bdist.linux-x86_64/egg/shapely/geometry
copying build/lib/shapely/geometry/geo.py -> build/bdist.linux-x86_64/egg/shapely/geometry
copying build/lib/shapely/geometry/proxy.py -> build/bdist.linux-x86_64/egg/shapely/geometry
copying build/lib/shapely/geometry/__init__.py -> build/bdist.linux-x86_64/egg/shapely/geometry
copying build/lib/shapely/geometry/base.py -> build/bdist.linux-x86_64/egg/shapely/geometry
copying build/lib/shapely/linref.py -> build/bdist.linux-x86_64/egg/shapely
copying build/lib/shapely/__init__.py -> build/bdist.linux-x86_64/egg/shapely
copying build/lib/shapely/ctypes_declarations.py -> build/bdist.linux-x86_64/egg/shapely
copying build/lib/shapely/_geos.pxi -> build/bdist.linux-x86_64/egg/shapely
copying build/lib/shapely/impl.py -> build/bdist.linux-x86_64/egg/shapely
copying build/lib/shapely/ops.py -> build/bdist.linux-x86_64/egg/shapely
creating build/bdist.linux-x86_64/egg/shapely/vectorized
copying build/lib/shapely/vectorized/_vectorized.pyx -> build/bdist.linux-x86_64/egg/shapely/vectorized
copying build/lib/shapely/vectorized/__init__.py -> build/bdist.linux-x86_64/egg/shapely/vectorized
byte-compiling build/bdist.linux-x86_64/egg/shapely/iterops.py to iterops.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/shapely/validation.py to validation.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/shapely/wkb.py to wkb.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/shapely/_buildcfg.py to _buildcfg.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/shapely/geos.py to geos.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/shapely/topology.py to topology.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/shapely/affinity.py to affinity.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/shapely/wkt.py to wkt.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/shapely/predicates.py to predicates.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/shapely/algorithms/cga.py to cga.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/shapely/algorithms/__init__.py to __init__.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/shapely/algorithms/polylabel.py to polylabel.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/shapely/speedups/__init__.py to __init__.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/shapely/prepared.py to prepared.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/shapely/strtree.py to strtree.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/shapely/examples/dissolve.py to dissolve.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/shapely/examples/geoms.py to geoms.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/shapely/examples/intersect.py to intersect.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/shapely/examples/__init__.py to __init__.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/shapely/coords.py to coords.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/shapely/errors.py to errors.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/shapely/geometry/multilinestring.py to multilinestring.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/shapely/geometry/multipoint.py to multipoint.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/shapely/geometry/linestring.py to linestring.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/shapely/geometry/collection.py to collection.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/shapely/geometry/polygon.py to polygon.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/shapely/geometry/point.py to point.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/shapely/geometry/multipolygon.py to multipolygon.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/shapely/geometry/geo.py to geo.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/shapely/geometry/proxy.py to proxy.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/shapely/geometry/__init__.py to __init__.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/shapely/geometry/base.py to base.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/shapely/linref.py to linref.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/shapely/__init__.py to __init__.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/shapely/ctypes_declarations.py to ctypes_declarations.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/shapely/impl.py to impl.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/shapely/ops.py to ops.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/shapely/vectorized/__init__.py to __init__.cpython-38.pyc
creating build/bdist.linux-x86_64/egg/EGG-INFO
copying Shapely.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying Shapely.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying Shapely.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying Shapely.egg-info/requires.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying Shapely.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
shapely.__pycache__._buildcfg.cpython-38: module references __file__
shapely.__pycache__.geos.cpython-38: module references __file__
creating dist
creating 'dist/Shapely-1.7a2-py3.8.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing Shapely-1.7a2-py3.8.egg
creating /usr/local/lib/python3.8/site-packages/Shapely-1.7a2-py3.8.egg
Extracting Shapely-1.7a2-py3.8.egg to /usr/local/lib/python3.8/site-packages
Adding Shapely 1.7a2 to easy-install.pth file

Installed /usr/local/lib/python3.8/site-packages/Shapely-1.7a2-py3.8.egg
Processing dependencies for Shapely==1.7a2
Finished processing dependencies for Shapely==1.7a2
setup.py:401: DeprecationWarning: The 'warn' method is deprecated, use 'warning' instead
  log.warn(BUILD_EXT_WARNING)
WARNING:setup.py:The C extension could not be compiled, speedups are not enabled.
 ---> c52aa622fe68
Removing intermediate container 4e118ceb8e71
Step 6/6 : RUN python -c "from shapely import vectorized"
 ---> Running in 13c2ec9718aa
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python3.8/site-packages/Shapely-1.7a2-py3.8.egg/shapely/vectorized/__init__.py", line 3, in <module>
    from ._vectorized import (contains, touches)
ModuleNotFoundError: No module named 'shapely.vectorized._vectorized'
The command '/bin/sh -c python -c "from shapely import vectorized"' returned a non-zero code: 1

@mikedh danke für

Die Quelldistribution Shapely 1.6.4.post2 (sdist) ist defekt und enthält keine _vectorized.c-Datei.

$ tar tzvf ~/Downloads/Shapely-1.6.4.post2.tar.gz | grep "\.c$"
-rw-r--r--  0 sean   staff  558528 Jul 18  2018 Shapely-1.6.4.post2/shapely/speedups/_speedups.c

Der formschöne 1.7a2 sdist tut es.

$ tar tzvf ~/Downloads/Shapely-1.7a2.tar.gz | grep "\.c$"
-rw-r--r--  0 seang  staff  578825 Jun 21  2019 Shapely-1.7a2/shapely/speedups/_speedups.c
-rw-r--r--  0 seang  staff  897094 Aug 30  2016 Shapely-1.7a2/shapely/vectorized/_vectorized.c

Wären Sie bereit, die 1.7a2-Vorabversion auszuprobieren? Es ist meiner Meinung nach in einem guten Zustand. Es hat weit weniger bekannte Fehler als 1.6.4.post2 und scheint den Benutzern von Geopandas recht gute Dienste zu leisten. Wenn nicht, können Sie Python 3.7 ausprobieren, wir haben Binärräder auf PyPI für py37 und formschöne 1.6.4.post2.

Danke, dass du das aufgespürt hast! Yup sieht so aus, als ob 1.7a2 den Trick macht .

Irgendwie seltsam, dass es reproduzierbar war, selbst wenn es aus einem Klon des Repositorys erstellt wurde, vielleicht fehlten die Geos-Header oder so? Fühlen Sie sich frei, zu schließen, oder wir können warten, bis die Veröffentlichung geschlossen ist.

Für andere Leute, die die Vorabversion möchten, können Sie sie mit installieren:
pip install shapely==1.7a2

Trimesh-Benutzer hier, dieser Thread hat mir den Tag gerettet.

Props an die Mitwirkenden für die Version 1.7.0 einschließlich des Fixes!

War diese Seite hilfreich?
0 / 5 - 0 Bewertungen

Verwandte Themen

MarkWieczorek picture MarkWieczorek  ·  4Kommentare

sgillies picture sgillies  ·  6Kommentare

kannes picture kannes  ·  4Kommentare

doctor-ian picture doctor-ian  ·  4Kommentare

chivasblue picture chivasblue  ·  3Kommentare