Skip to content

Notebook does not work on Windows, "ImportError: DLL load failed while importing shell: The specified procedure could not be found." #277

Closed
@phil-blain

Description

@phil-blain

What happened: I tried to open the "Calculating ENSO with Xarray" tutorial on my Windows laptop. It does not work because of some error with package pywin32.

What you expected to happen: It works.

Minimal Complete Verifiable Example:

  1. Install Miniconda (well, Miniforge)
  2. Follow https://foundations.projectpythia.org/preamble/how-to-use.html:
conda env create --force -f https://raw.githubusercontent.com/ProjectPythia/pythia-foundations/main/environment.yml
conda activate pythia-book-dev
git clone git@github.com:ProjectPythia/pythia-foundations.git
cd pythia-foundations
jupyter notebook

then open "enso-xarray" Notebook and execute the first cell. Result:

ImportError: DLL load failed while importing shell: The specified procedure could not be found.
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_31200/1210338269.py in <module>
      2 import matplotlib.pyplot as plt
      3 import xarray as xr
----> 4 from pythia_datasets import DATASETS

~\AppData\Local\miniforge3\envs\pythia-book-dev\lib\site-packages\pythia_datasets\__init__.py in <module>
      4 from pkg_resources import DistributionNotFound, get_distribution
      5 
----> 6 from .datasets import DATASETS, locate
      7 
      8 try:

~\AppData\Local\miniforge3\envs\pythia-book-dev\lib\site-packages\pythia_datasets\datasets.py in <module>
      3 
      4 DATASETS = pooch.create(
----> 5     path=pooch.os_cache('pythia-datasets'),
      6     base_url='https://github.com/ProjectPythia/pythia-datasets/raw/main/data/',
      7     env='PYTHIA_DATASETS_DIR',

~\AppData\Local\miniforge3\envs\pythia-book-dev\lib\site-packages\pooch\utils.py in os_cache(project)
     97 
     98     """
---> 99     return Path(appdirs.user_cache_dir(project))
    100 
    101 

~\AppData\Local\miniforge3\envs\pythia-book-dev\lib\site-packages\appdirs.py in user_cache_dir(appname, appauthor, version, opinion)
    291         if appauthor is None:
    292             appauthor = appname
--> 293         path = os.path.normpath(_get_win_folder("CSIDL_LOCAL_APPDATA"))
    294         if appname:
    295             if appauthor is not False:

~\AppData\Local\miniforge3\envs\pythia-book-dev\lib\site-packages\appdirs.py in _get_win_folder_with_pywin32(csidl_name)
    478 
    479 def _get_win_folder_with_pywin32(csidl_name):
--> 480     from win32com.shell import shellcon, shell
    481     dir = shell.SHGetFolderPath(0, getattr(shellcon, csidl_name), 0, 0)
    482     # Try to make this a unicode path because SHGetFolderPath does

ImportError: DLL load failed while importing shell: The specified procedure could not be found.

Anything else we need to know?: I read https://github.com/mhammond/pywin32#the-specified-procedure-could-not-be-found--entry-point-not-found-errors but I'm not administrator on my computer...

Environment:

  • Python version: 3.8.13
  • Operating System: Windows 10 1909
  • Install method (conda, pip, source): conda

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssues that present a reasonable conviction there is a reproducible bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions