PyPy from shapely.geos import causes "TypeError: unsupported operand type(s) for +: 'list' and 'tuple'"
See original GitHub issueExpected behavior and actual behavior.
PyPy is able to import from shapely.geos.
Steps to reproduce the problem.
While running Travis tests on geoalchemy2.
__________________ ERROR collecting tests/test_comparator.py ___________________
tests/test_comparator.py:5: in <module>
from geoalchemy2.types import Geometry
geoalchemy2/__init__.py:1: in <module>
from .types import ( # NOQA
geoalchemy2/types.py:17: in <module>
from .shape import to_shape
geoalchemy2/shape.py:10: in <module>
import shapely.wkb
.tox/pypysqla11/site-packages/shapely/wkb.py:4: in <module>
from shapely.geos import WKBReader, WKBWriter, lgeos
.tox/pypysqla11/site-packages/shapely/geos.py:224: in <module>
new_func.argtypes = [c_void_p] + old_func.argtypes
E TypeError: unsupported operand type(s) for +: 'list' and 'tuple'
https://travis-ci.org/github/geoalchemy/geoalchemy2/jobs/662462792#L760
I’ve tried PyPy and PyPy3.
Tests on Python 2.7, 3.{5,6,7,8} work fine.
Unfortunately I don’t have PyPy installed locally to test further.
Can this be changed to
new_func.argtypes = [c_void_p] + list(old_func.argtypes)
Not that I know if that would work, or quite why it was needed.
Operating system
Linux Ubuntu Xenial (Travis)
Shapely version and provenance
1.70 installed from PyPI using pip. https://files.pythonhosted.org/packages/44/ec/4eddbf9d17a917c51fb4ad159aa7137f506681e91ab559cf87d120e1d78d/Shapely-1.7.0.tar.gz
libgeos-3.7.1
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:5 (2 by maintainers)
Top Results From Across the Web
PyPy from shapely.geos import causes "TypeError ... - GitHub
PyPy from shapely.geos import causes "TypeError: unsupported operand type(s) for +: 'list' and 'tuple'" #866.
Read more >TypeError: unsupported operand type(s) for /: 'tuple' and 'int'
The error message is very explicit: return (data[i - 1] + data[i])/2 TypeError: unsupported operand type(s) for /: 'tuple' and 'int'.
Read more >[Example code]-Issue installing shapely Python Package
I am running python 3.6 on windows and am attempting to install Shapely using pip install shapely==1.6b2. It is giving me the following...
Read more >unsupported operand type(s) for /: 'int' and 'tuple' mean in ...
It means you have lost track of what data you hold in each of your variables, and also you seem to assume that...
Read more >Browse Python Technical Problem Clusters - Code Grepper
failed to convert a numpy array to a tensor (unsupported object type tuple). values outside range pandas · python3 copy file · read...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for the quick update. I’ve tested geoalchemy2 with https://github.com/Toblerity/Shapely/archive/9ca22240d3272df9598c30878c6f8562e50f1ec8.tar.gz and it is passing all tests with PyPy and Python 2.7, 3.{5-8}.
any chance on publishing this to pypi please?