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

Problems installing h5py / importing netCDF4 #366

Open
woldmuyn opened this issue Nov 10, 2022 · 0 comments
Open

Problems installing h5py / importing netCDF4 #366

woldmuyn opened this issue Nov 10, 2022 · 0 comments

Comments

@woldmuyn
Copy link
Contributor

woldmuyn commented Nov 10, 2022

Technical questions

  • Python version: 3.10.6
  • Operating System: Windows 64 bit

Description

After updating the environment, I got following errors when importing other packages in a .py file: ImportError: DLL load failed while importing _netCDF4: The specified procedure could not be found.

In a Jupiter file everything still worked fine
Probably a Windows issue

Solution

Importing netCDF4 before every other package

Traceback

PS D:\GitHub\COVID19-Model> conda activate COVID_MODEL
PS D:\GitHub\COVID19-Model> & C:/Users/wolfd/.conda/envs/COVID_MODEL/python.exe d:/GitHub/COVID19-Model/notebooks/calibration/woldmuyn_constraint_PI_calibration.py
Traceback (most recent call last):
  File "d:\GitHub\COVID19-Model\notebooks\calibration\woldmuyn_constraint_PI_calibration.py", line 23, in <module>
    from covid19model.models.base import BaseModel
  File "d:\github\covid19-model\src\covid19model\models\base.py", line 7, in <module>
    import xarray
  File "C:\Users\wolfd\.conda\envs\COVID_MODEL\lib\site-packages\xarray\__init__.py", line 1, in <module>
    from . import testing, tutorial, ufuncs
  File "C:\Users\wolfd\.conda\envs\COVID_MODEL\lib\site-packages\xarray\tutorial.py", line 13, in <module>
    from .backends.api import open_dataset as _open_dataset
  File "C:\Users\wolfd\.conda\envs\COVID_MODEL\lib\site-packages\xarray\backends\__init__.py", line 9, in <module> 
    from .h5netcdf_ import H5NetCDFStore
  File "C:\Users\wolfd\.conda\envs\COVID_MODEL\lib\site-packages\xarray\backends\h5netcdf_.py", line 25, in <module>
    from .netCDF4_ import (
  File "C:\Users\wolfd\.conda\envs\COVID_MODEL\lib\site-packages\xarray\backends\netCDF4_.py", line 33, in <module>    import netCDF4
  File "C:\Users\wolfd\.conda\envs\COVID_MODEL\lib\site-packages\netCDF4\__init__.py", line 3, in <module>
    from ._netCDF4 import *
ImportError: DLL load failed while importing _netCDF4: The specified procedure could not be found.
@woldmuyn woldmuyn changed the title Problems installing h5py Problems installing h5py / importing netCDF4 Nov 10, 2022
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