Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

failing docker run ImportError: libexpat.so.1: cannot open shared object file: No such file or directory #166

Closed
soxofaan opened this issue Jan 9, 2025 · 5 comments
Assignees

Comments

@soxofaan
Copy link
Member

soxofaan commented Jan 9, 2025

deploy of latest docker images seem to be failing with

ImportError: libexpat.so.1: cannot open shared object file: No such file or directory
@soxofaan
Copy link
Member Author

soxofaan commented Jan 9, 2025

minimal reproduction:

docker run --rm -it python:3.11-slim-bookworm /bin/bash
...
root@a3dc5e1dc008:/# python -m pip install fiona
...
Successfully installed ... fiona-1.10.1
...
root@a3dc5e1dc008:/# python -c "import fiona"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python3.11/site-packages/fiona/__init__.py", line 42, in <module>
    from fiona._env import (
ImportError: libexpat.so.1: cannot open shared object file: No such file or directory

staying below fiona 1.10 seems to work however

...
root@a3dc5e1dc008:/# python -m pip install 'fiona<1.10'
...
Successfully installed fiona-1.9.6
... 
root@a3dc5e1dc008:/# python -c "import fiona; print(fiona)"
<module 'fiona' from '/usr/local/lib/python3.11/site-packages/fiona/__init__.py'>

@soxofaan
Copy link
Member Author

soxofaan commented Jan 9, 2025

reported upstream to fiona repo:

@soxofaan
Copy link
Member Author

soxofaan commented Jan 9, 2025

with fiona<1.10 quickfix from 8f1cd37 it seems to work again

@soxofaan
Copy link
Member Author

soxofaan commented Jan 9, 2025

another solution that works with 1.10.1 is installing libexpat1 package first

root@c4ab4a8d0a92:/# python -m pip install -U 'fiona==1.10.1'
root@c4ab4a8d0a92:/# apt-get update
root@c4ab4a8d0a92:/# apt-get install libexpat1
root@c4ab4a8d0a92:/# python -c "import fiona"
# doesn't fail

I'd await response on Toblerity/Fiona#1480 to see what is most future proof solution

@soxofaan soxofaan self-assigned this Jan 9, 2025
soxofaan added a commit that referenced this issue Jan 10, 2025
new requirement for fiona>=1.10 (transitive dep from openeo_driver) in newer slim images

also see Toblerity/Fiona#1481
@soxofaan
Copy link
Member Author

ok so it seems that explicitly installing libexpat1 is the better way forward -> d810c0c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant