I am trying to use predixcan software. In that one of the script utilise h5py module. When I run the script, and it gives the following error:
Could not import HDF5 expression INFO - Could not import h5py module
Does anyone know how to resolve this error?
Install h5py with pip install h5py, if you are using pip, or with conda install h5py if you are using Anaconda.
Related
I create a fresh environment, install numpy, then install GDAL. GDAL imports successfully and I can open images using gdal.Open(, but I get the ImportError: cannot import name '_gdal_array' from 'osgeo' error when trying to use ReadAsRaster.
pip list returns:
GDAL 3.6.2
numpy 1.24.2
pip 23.0
setuptools 65.6.3
wheel 0.38.4
Completely stumped, has anyone come across this? Google tells me that installing numpy first is the solution (but that doesn't help). Help would be much appreciated.
I am trying to read a shapefile using python's geopandas in vscode. I successfully installed geopandas using conda, but when I use gpd.read_file, I get the following error output:
ImportError: the 'read_file' function requires the 'fiona' package, but it is not installed or does not import correctly.
Importing fiona resulted in: DLL load failed while importing ogrext: The specified module could not be founds
I am trying to follow the following solution: ImportError: the 'read_file' function requires the 'fiona' package, but it is not installed or does not import correctly. Importing fiona resulted in:
Apparently, I was using below versions of GDAL and fiona combinations which didn't work for me.
GDAL-3.3.2-cp38-cp38-win_amd64.whl
Fiona-1.8.20-cp38-cp38-win_amd64.whl
I had to uninstall the above versions and install the below versions instead. This resolved the issue.
GDAL-3.2.3-cp38-cp38-win_amd64.whl
Fiona‑1.8.19‑cp38‑cp38‑win_amd64.whl
Should I uninstall gdal and fiona using pip uninstall gdal fiona and then use pip install <version> to install the working versions? Also, since the post is from Oct 2021, should I still use the mentioned versions?
I just got a new computer and after downloading the newest version of the anaconda distribution I tried to install geopandas and run my script.
However, the gpd.read_file command causes an ImportError.
I have been trying to reinstall everything but nothing changed.
Does anybody know how to figure this out?
import geopandas as gpd
path = "C:/someshapefile.shp"
gpd.read_file(path)
ImportError: The 'read_file' function requires the 'pyogrio' or
'fiona' package, but neither is installed or imports correctly.
Importing fiona resulted in:
DLL load failed while importing ogrext: The specified module could not be found.
Importing pyogrio resulted in:
No module named 'pyogrio'
Just installing fiona manually like this:
conda install -c conda-forge fiona
did unfortunately not work for me.
Thanks a lot!
CM
git issue comment
python -m pip install git+https://github.com/Toblerity/Fiona.git
working for me
I'm trying to install pandas using pip3, but the install fails. I've reinstalled numpy as the error recommends, but it didn't help. A Google search failed to turn up a solution for me.
I have installed:
Python 3.6.5-1
numpy 1.14.4
I'm using "pip3 install pandas", and it's trying to install pandas 0.23.0. Here's the error:
ImportError:
Importing the multiarray numpy extension module failed. Most
likely you are trying to import a failed build of numpy.
If you're working with a numpy git repo, try `git clean -xdf` (removes all
files not under version control). Otherwise reinstall numpy.
Original error was: Could not load module /QOpenSys/pkgs/lib/python3.6/site-packages/numpy/core/multiarray.so.
The local-exec model was used for thread-local
storage, but the module is not the main program.
Examine the .loader section header with the 'dump -Hv' command.
I installed Python package Fiona. When I try to import it in my application, I get the following error:
File "C:\Anaconda3\lib\site-packages\fiona\collection.py", line 7, in
from fiona.ogrext import Iterator, ItemsIterator, KeysIterator
ImportError: DLL load failed: The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log or use the command-line sxstrace.exe tool for more detail.
I used Windows's "Event Viewer" and checked the problem:
Activation context generation failed for
"C:\Anaconda3\Library\bin\netcdf.dll". Dependent Assembly
Microsoft.VC90.DebugCRT,processorArchitecture="amd64",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="9.0.21022.8"
could not be found. Please use sxstrace.exe for detailed diagnosis.
From this question I gather that some module is using a debug library, which it shouldn't. I thought that maybe it's GDAL? How can I detect whether Fiona itself or some dependency of Fiona is doing it?
I tried to uninstall Fiona (and GDAL) and reinstall them.
I can successfully uninstall and install them using:
conda uninstall fiona
conda uninstall gdal
conda install fiona
conda install gdal
But the error remains.
I got my code working by using the Windows binaries from the following page:
http://www.lfd.uci.edu/~gohlke/pythonlibs/
and installing them with the command:
pip install C:\<path>\some_wheel.whl