conda-forge / netcdf4-feedstock

A conda-smithy repository for netcdf4.
BSD 3-Clause "New" or "Revised" License
3 stars 25 forks source link

Impossible import of netcdf4 despite being installed #145

Closed AlxLhrNc closed 1 year ago

AlxLhrNc commented 1 year ago

Solution to issue cannot be found in the documentation.

Issue

Using import netcdf4 produces the following error:

Traceback (most recent call last):

  File "C:\Users\alhe551\AppData\Local\Temp\ipykernel_6000\3060443057.py", line 1, in <cell line: 1>
    import netcdf4

ModuleNotFoundError: No module named 'netcdf4'

Error can be reproduced in an emvironment setup by conda create -n nctest -c conda-forge python=3.9.13 spyder=5.2.2 netcdf4.

I already checked "ImportError: DLL load failed #78" to no avail. Additionally, conda info throw an error rather than normal output.

Installed packages

alabaster                 0.7.12                     py_0    conda-forge
arrow                     1.2.3              pyhd8ed1ab_0    conda-forge
astroid                   2.12.12          py39hcbf5309_1    conda-forge
atomicwrites              1.4.1              pyhd8ed1ab_0    conda-forge
attrs                     22.1.0             pyh71513ae_1    conda-forge
autopep8                  1.6.0              pyhd8ed1ab_1    conda-forge
babel                     2.11.0             pyhd8ed1ab_0    conda-forge
backcall                  0.2.0              pyh9f0ad1d_0    conda-forge
backports                 1.0                        py_2    conda-forge
backports.functools_lru_cache 1.6.4              pyhd8ed1ab_0    conda-forge
bcrypt                    3.2.2            py39ha55989b_1    conda-forge
beautifulsoup4            4.11.1             pyha770c72_0    conda-forge
binaryornot               0.4.4                      py_1    conda-forge
black                     22.10.0          py39hcbf5309_2    conda-forge
bleach                    5.0.1              pyhd8ed1ab_0    conda-forge
brotlipy                  0.7.0           py39ha55989b_1005    conda-forge
bzip2                     1.0.8                h8ffe710_4    conda-forge
ca-certificates           2022.9.24            h5b45459_0    conda-forge
certifi                   2022.9.24          pyhd8ed1ab_0    conda-forge
cffi                      1.15.1           py39h68f70e3_2    conda-forge
cftime                    1.6.2            py39hc266a54_1    conda-forge
chardet                   5.0.0            py39hcbf5309_1    conda-forge
charset-normalizer        2.1.1              pyhd8ed1ab_0    conda-forge
click                     8.1.3           win_pyhd8ed1ab_2    conda-forge
cloudpickle               2.2.0              pyhd8ed1ab_0    conda-forge
colorama                  0.4.6              pyhd8ed1ab_0    conda-forge
cookiecutter              2.1.1              pyh6c4a22f_0    conda-forge
cryptography              38.0.3           py39h58e9bdb_0    conda-forge
curl                      7.86.0               heaf79c2_1    conda-forge
debugpy                   1.6.3            py39h99910a6_1    conda-forge
decorator                 5.1.1              pyhd8ed1ab_0    conda-forge
defusedxml                0.7.1              pyhd8ed1ab_0    conda-forge
diff-match-patch          20200713           pyh9f0ad1d_0    conda-forge
dill                      0.3.6              pyhd8ed1ab_1    conda-forge
docutils                  0.19             py39hcbf5309_1    conda-forge
entrypoints               0.4                pyhd8ed1ab_0    conda-forge
flake8                    4.0.1              pyhd8ed1ab_2    conda-forge
gettext                   0.21.1               h5728263_0    conda-forge
glib                      2.74.1               h12be248_1    conda-forge
glib-tools                2.74.1               h12be248_1    conda-forge
gst-plugins-base          1.21.1               h001b923_1    conda-forge
gstreamer                 1.21.1               h6b5321d_1    conda-forge
hdf4                      4.2.15               h1b1b6ef_5    conda-forge
hdf5                      1.12.2          nompi_h2a0e4a3_100    conda-forge
icu                       70.1                 h0e60522_0    conda-forge
idna                      3.4                pyhd8ed1ab_0    conda-forge
imagesize                 1.4.1              pyhd8ed1ab_0    conda-forge
importlib-metadata        5.0.0              pyha770c72_1    conda-forge
importlib_metadata        5.0.0                hd8ed1ab_1    conda-forge
importlib_resources       5.10.0             pyhd8ed1ab_0    conda-forge
inflection                0.5.1              pyh9f0ad1d_0    conda-forge
intel-openmp              2022.1.0          h57928b3_3787    conda-forge
intervaltree              3.0.2                      py_0    conda-forge
ipykernel                 6.17.1             pyh025b116_0    conda-forge
ipython                   7.33.0           py39hcbf5309_0    conda-forge
ipython_genutils          0.2.0                      py_1    conda-forge
isort                     5.10.1             pyhd8ed1ab_0    conda-forge
jaraco.classes            3.2.3              pyhd8ed1ab_0    conda-forge
jedi                      0.18.1             pyhd8ed1ab_2    conda-forge
jellyfish                 0.9.0            py39ha55989b_2    conda-forge
jinja2                    3.1.2              pyhd8ed1ab_1    conda-forge
jinja2-time               0.2.0              pyhd8ed1ab_3    conda-forge
jpeg                      9e                   h8ffe710_2    conda-forge
jsonschema                4.17.0             pyhd8ed1ab_0    conda-forge
jupyter_client            7.4.6              pyhd8ed1ab_0    conda-forge
jupyter_core              5.0.0            py39hcbf5309_0    conda-forge
jupyterlab_pygments       0.2.2              pyhd8ed1ab_0    conda-forge
keyring                   23.11.0          py39hcbf5309_0    conda-forge
krb5                      1.19.3               h1176d77_0    conda-forge
lazy-object-proxy         1.8.0            py39ha55989b_0    conda-forge
libblas                   3.9.0              16_win64_mkl    conda-forge
libcblas                  3.9.0              16_win64_mkl    conda-forge
libclang                  15.0.4          default_h77d9078_0    conda-forge
libclang13                15.0.4          default_h77d9078_0    conda-forge
libcurl                   7.86.0               heaf79c2_1    conda-forge
libffi                    3.4.2                h8ffe710_5    conda-forge
libglib                   2.74.1               he8f3873_1    conda-forge
libiconv                  1.17                 h8ffe710_0    conda-forge
liblapack                 3.9.0              16_win64_mkl    conda-forge
libnetcdf                 4.8.1           nompi_h8c042bf_106    conda-forge
libogg                    1.3.4                h8ffe710_1    conda-forge
libpng                    1.6.38               h19919ed_0    conda-forge
libsodium                 1.0.18               h8d14728_1    conda-forge
libspatialindex           1.9.3                h39d44d4_4    conda-forge
libsqlite                 3.39.4               hcfcfb64_0    conda-forge
libssh2                   1.10.0               h680486a_3    conda-forge
libvorbis                 1.3.7                h0e60522_0    conda-forge
libxml2                   2.10.3               hc3477c8_0    conda-forge
libzip                    1.9.2                hfed4ece_1    conda-forge
libzlib                   1.2.13               hcfcfb64_4    conda-forge
markupsafe                2.1.1            py39ha55989b_2    conda-forge
matplotlib-inline         0.1.6              pyhd8ed1ab_0    conda-forge
mccabe                    0.6.1                      py_1    conda-forge
mistune                   2.0.4              pyhd8ed1ab_0    conda-forge
mkl                       2022.1.0           h6a75c08_874    conda-forge
more-itertools            9.0.0              pyhd8ed1ab_0    conda-forge
mypy_extensions           0.4.3            py39hcbf5309_6    conda-forge
nbclient                  0.7.0              pyhd8ed1ab_0    conda-forge
nbconvert                 7.2.5              pyhd8ed1ab_0    conda-forge
nbconvert-core            7.2.5              pyhd8ed1ab_0    conda-forge
nbconvert-pandoc          7.2.5              pyhd8ed1ab_0    conda-forge
nbformat                  5.7.0              pyhd8ed1ab_0    conda-forge
nest-asyncio              1.5.6              pyhd8ed1ab_0    conda-forge
netcdf4                   1.6.1           nompi_py39h34fa13a_101    conda-forge
numpy                     1.23.4           py39hbccbffa_1    conda-forge
numpydoc                  1.5.0              pyhd8ed1ab_0    conda-forge
openssl                   1.1.1s               hcfcfb64_0    conda-forge
packaging                 21.3               pyhd8ed1ab_0    conda-forge
pandoc                    2.19.2               h57928b3_1    conda-forge
pandocfilters             1.5.0              pyhd8ed1ab_0    conda-forge
paramiko                  2.12.0             pyhd8ed1ab_0    conda-forge
parso                     0.8.3              pyhd8ed1ab_0    conda-forge
pathspec                  0.10.2             pyhd8ed1ab_0    conda-forge
pcre2                     10.40                h17e33f8_0    conda-forge
pexpect                   4.8.0              pyh1a96a4e_2    conda-forge
pickleshare               0.7.5                   py_1003    conda-forge
pip                       22.3.1             pyhd8ed1ab_0    conda-forge
pkgutil-resolve-name      1.3.10             pyhd8ed1ab_0    conda-forge
platformdirs              2.5.2              pyhd8ed1ab_1    conda-forge
pluggy                    1.0.0              pyhd8ed1ab_5    conda-forge
ply                       3.11                       py_1    conda-forge
prompt-toolkit            3.0.32             pyha770c72_0    conda-forge
psutil                    5.9.4            py39ha55989b_0    conda-forge
ptyprocess                0.7.0              pyhd3deb0d_0    conda-forge
pycodestyle               2.8.0              pyhd8ed1ab_0    conda-forge
pycparser                 2.21               pyhd8ed1ab_0    conda-forge
pydocstyle                6.1.1              pyhd8ed1ab_0    conda-forge
pyflakes                  2.4.0              pyhd8ed1ab_0    conda-forge
pygments                  2.13.0             pyhd8ed1ab_0    conda-forge
pylint                    2.15.5             pyhd8ed1ab_0    conda-forge
pyls-spyder               0.4.0              pyhd8ed1ab_0    conda-forge
pynacl                    1.5.0            py39h09fa780_2    conda-forge
pyopenssl                 22.1.0             pyhd8ed1ab_0    conda-forge
pyparsing                 3.0.9              pyhd8ed1ab_0    conda-forge
pyqt                      5.15.7           py39hb77abff_2    conda-forge
pyqt5-sip                 12.11.0          py39h99910a6_2    conda-forge
pyrsistent                0.19.2           py39ha55989b_0    conda-forge
pysocks                   1.7.1              pyh0701188_6    conda-forge
python                    3.9.13          h9a09f29_0_cpython    conda-forge
python-dateutil           2.8.2              pyhd8ed1ab_0    conda-forge
python-fastjsonschema     2.16.2             pyhd8ed1ab_0    conda-forge
python-lsp-black          1.1.0              pyhd8ed1ab_0    conda-forge
python-lsp-jsonrpc        1.0.0              pyhd8ed1ab_0    conda-forge
python-lsp-server         1.3.3              pyhd8ed1ab_0    conda-forge
python-slugify            6.1.2              pyhd8ed1ab_0    conda-forge
python_abi                3.9                      2_cp39    conda-forge
pytoolconfig              1.2.2              pyhd8ed1ab_0    conda-forge
pytz                      2022.6             pyhd8ed1ab_0    conda-forge
pywin32                   304              py39h99910a6_2    conda-forge
pywin32-ctypes            0.2.0           py39hcbf5309_1006    conda-forge
pyyaml                    6.0              py39ha55989b_5    conda-forge
pyzmq                     24.0.1           py39hea35a22_1    conda-forge
qdarkstyle                3.0.2              pyhd8ed1ab_0    conda-forge
qstylizer                 0.2.2              pyhd8ed1ab_0    conda-forge
qt-main                   5.15.6               h9c3277a_1    conda-forge
qtawesome                 1.2.1              pyhd8ed1ab_0    conda-forge
qtconsole                 5.2.2              pyhd8ed1ab_1    conda-forge
qtconsole-base            5.2.2              pyhd8ed1ab_1    conda-forge
qtpy                      2.3.0              pyhd8ed1ab_0    conda-forge
requests                  2.28.1             pyhd8ed1ab_1    conda-forge
rope                      1.4.0              pyhd8ed1ab_0    conda-forge
rtree                     1.0.1            py39h09fdee3_1    conda-forge
setuptools                65.5.1             pyhd8ed1ab_0    conda-forge
sip                       6.7.4            py39h99910a6_0    conda-forge
six                       1.16.0             pyh6c4a22f_0    conda-forge
snowballstemmer           2.2.0              pyhd8ed1ab_0    conda-forge
sortedcontainers          2.4.0              pyhd8ed1ab_0    conda-forge
soupsieve                 2.3.2.post1        pyhd8ed1ab_0    conda-forge
sphinx                    5.3.0              pyhd8ed1ab_0    conda-forge
sphinxcontrib-applehelp   1.0.2                      py_0    conda-forge
sphinxcontrib-devhelp     1.0.2                      py_0    conda-forge
sphinxcontrib-htmlhelp    2.0.0              pyhd8ed1ab_0    conda-forge
sphinxcontrib-jsmath      1.0.1                      py_0    conda-forge
sphinxcontrib-qthelp      1.0.3                      py_0    conda-forge
sphinxcontrib-serializinghtml 1.1.5              pyhd8ed1ab_2    conda-forge
spyder                    5.2.2            py39hcbf5309_3    conda-forge
spyder-kernels            2.2.1            py39hcbf5309_1    conda-forge
sqlite                    3.39.4               hcfcfb64_0    conda-forge
tbb                       2021.6.0             h91493d7_1    conda-forge
text-unidecode            1.3                        py_0    conda-forge
textdistance              4.5.0              pyhd8ed1ab_0    conda-forge
three-merge               0.1.1              pyh9f0ad1d_0    conda-forge
tinycss2                  1.2.1              pyhd8ed1ab_0    conda-forge
tk                        8.6.12               h8ffe710_0    conda-forge
toml                      0.10.2             pyhd8ed1ab_0    conda-forge
tomli                     2.0.1              pyhd8ed1ab_0    conda-forge
tomlkit                   0.11.6             pyha770c72_0    conda-forge
tornado                   6.2              py39ha55989b_1    conda-forge
traitlets                 5.5.0              pyhd8ed1ab_0    conda-forge
typing                    3.10.0.0           pyhd8ed1ab_0    conda-forge
typing-extensions         4.4.0                hd8ed1ab_0    conda-forge
typing_extensions         4.4.0              pyha770c72_0    conda-forge
tzdata                    2022f                h191b570_0    conda-forge
ucrt                      10.0.22621.0         h57928b3_0    conda-forge
ujson                     5.5.0            py39h99910a6_1    conda-forge
unidecode                 1.3.6              pyhd8ed1ab_0    conda-forge
urllib3                   1.26.11            pyhd8ed1ab_0    conda-forge
vc                        14.3                 h3d8a991_9    conda-forge
vs2015_runtime            14.32.31332          h1d6e394_9    conda-forge
watchdog                  2.1.9            py39hcbf5309_1    conda-forge
wcwidth                   0.2.5              pyh9f0ad1d_2    conda-forge
webencodings              0.5.1                      py_1    conda-forge
wheel                     0.38.4             pyhd8ed1ab_0    conda-forge
win_inet_pton             1.1.0              pyhd8ed1ab_6    conda-forge
wrapt                     1.14.1           py39ha55989b_1    conda-forge
xz                        5.2.6                h8d14728_0    conda-forge
yaml                      0.2.5                h8ffe710_2    conda-forge
yapf                      0.32.0             pyhd8ed1ab_0    conda-forge
zeromq                    4.3.4                h0e60522_1    conda-forge
zipp                      3.10.0             pyhd8ed1ab_0    conda-forge
zlib                      1.2.13               hcfcfb64_4    conda-forge
zstd                      1.5.2                h7755175_4    conda-forge

Environment info

# >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<

    Traceback (most recent call last):
      File "C:\Users\alhe551\Installed_Programs\Anaconda3\lib\site-packages\conda\exceptions.py", line 1129, in __call__
        return func(*args, **kwargs)
      File "C:\Users\alhe551\Installed_Programs\Anaconda3\lib\site-packages\conda\cli\main.py", line 86, in main_subshell
        exit_code = do_call(args, p)
      File "C:\Users\alhe551\Installed_Programs\Anaconda3\lib\site-packages\conda\cli\conda_argparse.py", line 93, in do_call
        return getattr(module, func_name)(args, parser)
      File "C:\Users\alhe551\Installed_Programs\Anaconda3\lib\site-packages\conda\cli\main_info.py", line 317, in execute
        info_dict = get_info_dict(args.system)
      File "C:\Users\alhe551\Installed_Programs\Anaconda3\lib\site-packages\conda\cli\main_info.py", line 150, in get_info_dict
        active_prefix_name = env_name(context.active_prefix)
      File "C:\Users\alhe551\Installed_Programs\Anaconda3\lib\site-packages\conda\base\context.py", line 1716, in env_name
        for envs_dir in context.envs_dirs:
      File "C:\Users\alhe551\Installed_Programs\Anaconda3\lib\site-packages\conda\base\context.py", line 542, in envs_dirs
        return mockable_context_envs_dirs(self.root_writable, self.root_prefix, self._envs_dirs)
      File "C:\Users\alhe551\Installed_Programs\Anaconda3\lib\site-packages\conda\base\context.py", line 114, in mockable_context_envs_dirs
        fixed_dirs += join(user_data_dir(APP_NAME, APP_NAME), 'envs'),
      File "C:\Users\alhe551\Installed_Programs\Anaconda3\lib\site-packages\conda\_vendor\appdirs.py", line 67, in user_data_dir
        path = os.path.join(_get_win_folder(const), appauthor, appname)
      File "C:\Users\alhe551\Installed_Programs\Anaconda3\lib\site-packages\conda\_vendor\appdirs.py", line 265, in _get_win_folder_with_pywin32
        from win32com.shell import shellcon, shell
    ImportError: DLL load failed while importing shell: The specified procedure could not be found.
ocefpaf commented 1 year ago

Something looks broken with your conda installation. You should be able to perform a conda info. I'd try to remove and reinstall it, preferably a lighter miniforge version. See https://github.com/conda-forge/miniforge/releases

AlxLhrNc commented 1 year ago

You are right in that my Anaconda was broken. Version 2022.10 is coming with conda 22.9 by default which seems to have an issue under windows 10 causing openssl not to work. The recommended fixes (see https://github.com/conda/conda/issues/11795) allowed 1 download but no subsequent ones.

Downgrading to Anaconda 2022.05 with conda 4.12.0 solve all issues with openssl as well as netcdf4. I'll just refrain from updating.

ocefpaf commented 1 year ago

Downgrading to Anaconda 2022.05 with conda 4.12.0 solve all issues with openssl as well as netcdf4. I'll just refrain from updating.

Good to know! Hopefully this will be fixed upstream quickly. Closing this b/c there is nothing we can do here. Feel free to re-open if you feel otherwise.