Shapely: vectorisé sur Python 3.8

Créé le 21 déc. 2019  ·  6Commentaires  ·  Source: Toblerity/Shapely

Il semble que from shapely import vectorized échoue sur Python 3.8 lorsque Shapely est installé via pip :

    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
J'ai également vu des rapports "dans la nature" à ce sujet, mais je ne sais pas sur quel Python ils étaient :
https://github.com/mikedh/trimesh/issues/667

Commentaire le plus utile

Merci d'avoir retracé ça ! Oui, on dirait que 1.7a2 fait l'affaire .

Un peu bizarre qu'il soit reproductible même lors de la construction à partir d'un clone du référentiel, peut-être manquait-il les en-têtes geos ou quelque chose du genre ? N'hésitez pas à fermer, ou nous pouvons attendre la fermeture de la sortie.

Pour les autres personnes qui souhaitent la pré-version, vous pouvez l'installer avec :
pip install shapely==1.7a2

Tous les 6 commentaires

@mikedh essayez-vous d'installer le pip dans un environnement conda ? J'en vois un indice sur https://travis-ci.org/mikedh/trimesh/jobs/627984786#L1048. Bien que cela puisse fonctionner pour les packages en python pur, cela ne peut pas fonctionner pour les packages qui incluent des modules d'extension comme le fait Shapely. Vous ne pouvez tout simplement pas installer les roues galbées sur PyPI dans un environnement conda, vous devez obtenir une forme galbée à partir d'un canal conda comme conda-forge.

Oui, pip install dans conda python est légèrement étrange, mais je pense que le problème est ailleurs et qu'il est reproductible sur la ligne principale Python. Voici un Dockerfile à reproduction minimale :

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"

Échec avec :

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

J'ai fait un peu de débogage et essayé quelques choses, dont aucune n'a fonctionné. Pour référence, voici un Dockerfile légèrement plus utile :

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"

Et la sortie complète des étapes de construction élégantes :

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 merci d'être patient et persévérant. J'ai trouvé le problème.

La distribution source Shapely 1.6.4.post2 (sdist) est défectueuse et n'inclut pas de fichier _vectorized.c.

$ 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

Le sdist 1.7a2 bien fait le fait.

$ 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

Seriez-vous prêt à essayer la pré-version 1.7a2 ? Il est en bon état, à mon avis. Il a beaucoup moins de bogues connus que 1.6.4.post2 et semble assez bien servir les utilisateurs de geopandas. Sinon, vous pouvez essayer python 3.7, nous avons des roues binaires sur PyPI pour py37 et bien fait 1.6.4.post2.

Merci d'avoir retracé ça ! Oui, on dirait que 1.7a2 fait l'affaire .

Un peu bizarre qu'il soit reproductible même lors de la construction à partir d'un clone du référentiel, peut-être manquait-il les en-têtes geos ou quelque chose du genre ? N'hésitez pas à fermer, ou nous pouvons attendre la fermeture de la sortie.

Pour les autres personnes qui souhaitent la pré-version, vous pouvez l'installer avec :
pip install shapely==1.7a2

Utilisateur de Trimesh ici, ce fil m'a sauvé la journée.

Accessoires aux contributeurs pour la version 1.7.0, y compris le correctif !

Cette page vous a été utile?
0 / 5 - 0 notes

Questions connexes

LostFan123 picture LostFan123  ·  5Commentaires

akadouri picture akadouri  ·  4Commentaires

ispmarin picture ispmarin  ·  3Commentaires

jGaboardi picture jGaboardi  ·  5Commentaires

chivasblue picture chivasblue  ·  3Commentaires