question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

vectorized on Python 3.8

See original GitHub issue

It looks like from shapely import vectorized fails on Python 3.8 when Shapely is installed 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 I saw some “in the wild” reports of this too, though not sure what Python they were on: https://github.com/mikedh/trimesh/issues/667

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
mikedhcommented, Dec 27, 2019

Thanks for tracking this down! Yup looks like 1.7a2 does the trick.

Kinda weird that it was reproducible even when building from a clone of the repo, maybe it was missing the geos headers or something? Feel free to close, or we can wait for the release to close.

For other people who want the pre-release you can install it with: pip install shapely==1.7a2

1reaction
sgilliescommented, Dec 27, 2019

@mikedh thank you for being patient and persistent. I’ve found the problem.

The Shapely 1.6.4.post2 source distribution (sdist) is defective and does not include a _vectorized.c file.

$ 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

The shapely 1.7a2 sdist does.

$ 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

Would you be willing to try the 1.7a2 pre-release? It’s in good shape, in my opinion. It has far fewer known bugs than 1.6.4.post2, and seems to be serving geopandas users quite well. If not, you might try python 3.7, we have binary wheels on PyPI for py37 and shapely 1.6.4.post2.

Read more comments on GitHub >

github_iconTop Results From Across the Web

vectorized on Python 3.8 · Issue #810 · shapely/shapely - GitHub
It looks like from shapely import vectorized fails on Python 3.8 when Shapely is installed via pip: from shapely import vectorized > from...
Read more >
Vectorized User-defined Functions | Apache Flink
Vectorized Python user-defined functions are functions which are executed by transferring a batch of elements between JVM and Python VM in Arrow columnar ......
Read more >
Vectorized Custom function not working as expected In pandas
Vectorizing an operation in pandas isn't always possible. I'm not aware of a pandas built-in vectorized way to get the type of the...
Read more >
vector · PyPI
Vector is a Python 3.7+ library for 2D, 3D, and Lorentz vectors, especially arrays of vectors, to solve common physics problems in a...
Read more >
uuid — UUID objects according to RFC 4122 ... - Python Docs
This module provides immutable UUID objects (the UUID class) and the functions uuid1() , uuid3() , uuid4() , uuid5() for generating version 1,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found