Giter Club home page Giter Club logo

Comments (6)

hobu avatar hobu commented on July 3, 2024

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.

thomasaarholt avatar thomasaarholt commented on July 3, 2024

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.

thomasaarholt avatar thomasaarholt commented on July 3, 2024

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.

hobu avatar hobu commented on July 3, 2024

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.

simaoafonso-pwt avatar simaoafonso-pwt commented on July 3, 2024

@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.

hobu avatar hobu commented on July 3, 2024

@simaoafonso-pwt Please stop spamming the repository. If you need 32bit wheels you will have to build them yourself.

from rtree.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.