-
Notifications
You must be signed in to change notification settings - Fork 207
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
Bug on Windows/Mac - partially initialized module 'fiona' has no attribute '_loading' #1085
Comments
@davide-f Could you check if |
The issue seems equivalent to this closed one: #944 However, this simple trick does not work in my case #944 (comment) |
@davide-f there is something in your environment that pins some libraries to older versions? Eg libgdal is using 3.3 and not 3.4. Unless you are specifically trying to create an test environment with older versions, I would try to first check if it works with the latest versions of gdal and fiona. |
Same happening for me on Mac. GDAL is installed via brew: brew info gdal brew info gdal
gdal: stable 3.4.2 (bottled), HEAD
Geospatial Data Abstraction Library
https://www.gdal.org/
Conflicts with:
avce00 (because both install a cpl_conv.h header)
cpl (because both install cpl_error.h)
/usr/local/Cellar/gdal/3.4.2_2 (356 files, 60.9MB) *
Poured from bottle on 2022-04-10 at 13:38:41
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/gdal.rb
License: MIT It seems to be looking for the wrong version of GDAL via import fiona Traceback (most recent call last):
File "/usr/local/Cellar/[email protected]/3.9.12/Frameworks/Python.framework/Versions/3.9/lib/python3.9/code.py", line 90, in runcode
exec(code, self.locals)
File "<input>", line 1, in <module>
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/fiona/__init__.py", line 86, in <module>
from fiona.collection import BytesCollection, Collection
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/fiona/collection.py", line 11, in <module>
from fiona.ogrext import Iterator, ItemsIterator, KeysIterator
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
ImportError: dlopen(/usr/local/lib/python3.9/site-packages/fiona/ogrext.cpython-39-darwin.so, 0x0002): Library not loaded: /usr/local/opt/gdal/lib/libgdal.28.dylib
Referenced from: /usr/local/lib/python3.9/site-packages/fiona/ogrext.cpython-39-darwin.so
Reason: tried: '/usr/local/opt/gdal/lib/libgdal.28.dylib' (no such file), '/usr/local/lib/libgdal.28.dylib' (no such file), '/usr/lib/libgdal.28.dylib' (no such file), '/usr/local/Cellar/gdal/3.4.2_2/lib/libgdal.28.dylib' (no such file), '/usr/local/lib/libgdal.28.dylib' (no such file), '/usr/lib/libgdal.28.dylib' (no such file) ls /usr/local/opt/gdal/lib
libgdal.30.dylib libgdal.a libgdal.dylib pkgconfig python3.9 Creating a link from |
Sorry for the delay, I thought I already replied. Actually no, to my knowledge, in the environment there is no limitation on the library version. |
Most likely GDAL was updated and Fiona was not reinstalled using the new GDAL libraries. Whenever the GDAL libraries are updated, Fiona needs to be recompiled/reinstalled using the new binaries. |
Is it possible to configure |
…1 does not work in windows)
…1 does not work in windows) (#331)
…1 does not work in windows) (#331)
…1 does not work in windows) (#331)
Expected behavior and actual behavior.
When using geopandas, shapley and fiona, the importing of files breaks on Mac OS.
The same problem does not occur on windows or linux.
The following error arises:
Steps to reproduce the problem.
This is reproducible in the CI shown in: https://github.com/pypsa-meets-africa/pypsa-africa/runs/5709176725?check_suite_focus=true
I attempted various ways, but most likely the errors arise while performing the following series of imports:
Operating system
Environment: macos-11
Version: 20220322.1
Fiona and GDAL version and provenance
Installed using the following environment file: https://github.com/pypsa-meets-africa/pypsa-africa/blob/main/envs/environment.yaml
The text was updated successfully, but these errors were encountered: