Comments (6)
I have an m1 mac. if you can add a Dockerfile and its build command that demonstrates the issue, I would be much more likely to attempt to address it.
These kinds of errors have been so hard to address. if you're using conda, you should use the conda-forge Rtree package instead of pip-installing the wheel. Maybe things are getting confused there.
from rtree.
A very reasonable request!
Here's a minimum working example of the issue. I suspect it will run fine if run on x86 architecture, but I have no way to confirm:
Dockerfile contents (example taken from @here for anyone who is new to this - the filename is Dockerfile
.)
FROM python:3.9-slim-buster
RUN pip install rtree
CMD ["sh", "-c", "python -c 'import rtree'"]
Run the following commands from the directory containing the dockerfile
docker build -t rtree_error .
docker run rtree
The error:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/local/lib/python3.9/site-packages/rtree/__init__.py", line 9, in <module>
from .index import Index, Rtree # noqa
File "/usr/local/lib/python3.9/site-packages/rtree/index.py", line 17, in <module>
from . import core
File "/usr/local/lib/python3.9/site-packages/rtree/core.py", line 74, in <module>
rt = finder.load()
File "/usr/local/lib/python3.9/site-packages/rtree/finder.py", line 118, in load
raise OSError("Could not load libspatialindex_c library")
OSError: Could not load libspatialindex_c library
from rtree.
These kinds of errors have been so hard to address. if you're using conda, you should use the conda-forge Rtree package instead of pip-installing the wheel. Maybe things are getting confused there.
I didn't fully address this - I would actually much prefer the pip-solution to work if possible. The only reason I created a conda environment is that I find the environment-functionality very convenient there (and I feel that venv / asdf aren't quite as user-friendly). The reason is that I'm using geopandas to build a geographical calendar at work, and at work everyone is using linux-in-docker via pip for reproducibility.
But I totally understand if this level of debugging is outside your scope! I can probably find a different way.
from rtree.
pip install Rtree
in this case only installed the source for the Python library, not the libspatialindex library that's also included with the wheels. That's because none of the wheels on https://pypi.org/project/Rtree/#files match the sys_tags.
In short, the wheel didn't get installed.
python -c "import packaging.tags; print(list(packaging.tags.sys_tags()))"
In this case, just do apt-get install libspatialindex-c5 -y
to pull that in and things should work.
from rtree.
@hobu The point of wheels is that all necessary libraries are included, right? At the very least, if the library is not found, the installation should fail, not only at runtime.
from rtree.
@simaoafonso-pwt Please stop spamming the repository. If you need 32bit wheels you will have to build them yourself.
from rtree.
Related Issues (20)
- typing_extensions now required HOT 1
- Using rtree in Cygwin HOT 1
- Please release a new version with the type hints support HOT 1
- Index is checking write access despite assuming read-only access HOT 3
- why .dat file modified after intersection query?
- Nearest Neighbour Metric
- how to output more information about the constructed Rtree HOT 1
- QUESTION: How can rtree.index.Index properties be used to tweak performance ? HOT 2
- Linux binary wheels have two copies of libspatialindex HOT 1
- Calculating the Height of an R-Tree: Where Did I Go Wrong? HOT 1
- Issue with Python 3.12.0rc1 HOT 5
- "Unable to open file '%s' for index storage" - Write permissions on index should not be required HOT 1
- About RTree Data Structure Persistent Storage HOT 3
- Release publishing automation HOT 1
- Allow string ids in indexes (or at least improve the error messages) HOT 2
- Determinism
- Python 3.11 support HOT 3
- Test failures with libspatialindex 2.0.0 HOT 9
- 1.3.0 release? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rtree.