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

ImportError: DLL load failed #7

Open
dpoursanidis opened this issue Jan 20, 2023 · 11 comments
Open

ImportError: DLL load failed #7

dpoursanidis opened this issue Jan 20, 2023 · 11 comments

Comments

@dpoursanidis
Copy link

Hi Nathan,

Following the guidelines i end to that error:

(bathymetry) D:\IC2data\C-SHELPh-main\C-SHELPh-main\4.Tutorial\code>python 1_test_env.py
Traceback (most recent call last):
File "D:\IC2data\C-SHELPh-main\C-SHELPh-main\4.Tutorial\code\1_test_env.py", line 24, in
raise e
File "D:\IC2data\C-SHELPh-main\C-SHELPh-main\4.Tutorial\code\1_test_env.py", line 17, in
import fiona
File "C:\Users\DimitrisPoursanidis\anaconda3\envs\bathymetry\lib\site-packages\fiona_init_.py", line 86, in
from fiona.collection import BytesCollection, Collection
File "C:\Users\DimitrisPoursanidis\anaconda3\envs\bathymetry\lib\site-packages\fiona\collection.py", line 11, in
from fiona.ogrext import Iterator, ItemsIterator, KeysIterator
ImportError: DLL load failed while importing ogrext: The specified procedure could not be found.

It seems that is linked (?) with GDAL (https://gis.stackexchange.com/questions/67372/fiona-importerror-dll-load-failed).

Any idea on how to solve it without complex processes?

Thanks

D.

@nmt28
Copy link
Owner

nmt28 commented Jan 20, 2023

Hi Dimitris,

This looks like an incompatibility issue between GDAL and Fiona. Are you using a windows system? How do you manage your python installs/environment? Anaconda?

@dpoursanidis
Copy link
Author

Win11 and Anaconda.
I see that the issue is due to what you describe.
What do you suggest (apart from linux movement :) )?

@nmt28
Copy link
Owner

nmt28 commented Jan 20, 2023

It looks like certain versions of Fiona and GDAL are not compatible. Fiona 1.8.9 supports GDAL 3.0 so I would recommend a new env with these specific versions

@dpoursanidis
Copy link
Author

I will test them and come back !

@dpoursanidis
Copy link
Author

Following your advice and running the condia install fiona=1.8.9 i have that conflict

Package fiona conflicts for:
fiona=1.8.9
geopandas -> fiona

Am running now a step by step package installation to identify which is incompatible with the rest.

@nmt28
Copy link
Owner

nmt28 commented Jan 25, 2023

Are you using the condo-forge channel? All packages in this channel should be compatible

@dpoursanidis
Copy link
Author

Yeap, we use conda-forge.

It seems from the below that i need to create env with python > 3.6 and python < 3.7, right?

(bathymetry) C:\Users\DimitrisPoursanidis>conda install -c conda-forge fiona=1.8.9
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: /
Found conflicts! Looking for incompatible packages.
This can take several minutes. Press CTRL-C to abort.- |failed
UnsatisfiableError: The following specifications were found
to be incompatible with the existing python installation in your environment:
Specifications:

  • fiona=1.8.9 -> python[version='>=3.6,<3.7.0a0|>=3.8,<3.9.0a0|>=3.7,<3.8.0a0']
    Your python: python=3.9

@nmt28
Copy link
Owner

nmt28 commented Jan 25, 2023

one thing to try would be to build an env on 3.9 and then do:

conda update --all

This sometimes resolves issues as it bring the latest (hopefully compatible) versions together

@dpoursanidis
Copy link
Author

now something else appear

(bathymetry) D:\IC2data\C-SHELPh-main\C-SHELPh-main\4.Tutorial\code>python 1_test_env.py
Traceback (most recent call last):
File "D:\IC2data\C-SHELPh-main\C-SHELPh-main\4.Tutorial\code\1_test_env.py", line 24, in
raise e
File "D:\IC2data\C-SHELPh-main\C-SHELPh-main\4.Tutorial\code\1_test_env.py", line 4, in
from matplotlib.widgets import LassoSelector
File "C:\Users\DimitrisPoursanidis\anaconda3\envs\bathymetry\lib\site-packages\matplotlib_init_.py", line 113, in
from . import _api, _version, cbook, _docstring, rcsetup
File "C:\Users\DimitrisPoursanidis\anaconda3\envs\bathymetry\lib\site-packages\matplotlib\rcsetup.py", line 27, in
from matplotlib.colors import Colormap, is_color_like
File "C:\Users\DimitrisPoursanidis\anaconda3\envs\bathymetry\lib\site-packages\matplotlib\colors.py", line 51, in
from PIL import Image
File "C:\Users\DimitrisPoursanidis\anaconda3\envs\bathymetry\lib\site-packages\PIL\Image.py", line 100, in
from . import _imaging as core
ImportError: DLL load failed while importing _imaging: The specified module could not be found.

@dpoursanidis
Copy link
Author

Hi

Did you find time to check it in windows machine?

D.

@nmt28
Copy link
Owner

nmt28 commented Feb 8, 2023

It looks like it cannot import matplotlib.widgets.LassoSelector. This module is no longer used - it was used in an old method. You can remove:

from matplotlib.widgets import LassoSelector
from matplotlib.path import Path

Remove these lines and try again

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

2 participants