2

I am trying to use awkward in my Windows 10 system. I am using python 3.8.2. After installing the package, when I import it, I am getting this DLL import error.

>>> import awkward as ak
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\MSS\Work\PyWorkspace37\awkward_poc\venv\lib\site-packages\awkward\__init__.py", line 23, in <module>
    import awkward.layout
  File "C:\Users\MSS\Work\PyWorkspace37\awkward_poc\venv\lib\site-packages\awkward\layout.py", line 5, in <module>
    from awkward._ext import Index8
ImportError: DLL load failed while importing _ext: The specified module could not be found.

How to know which DLL is missing and how to mitigate it?

MSS
  • 3,306
  • 1
  • 19
  • 50

1 Answers1

0

The DLL is Awkward Array's C++ part, "awkward/_ext.pyc", which the installation should have put into place. I see two possibilities: (1) the installation went horribly wrong and should be restarted from a clean slate, or (2) the file is there but can't be loaded. If the directory it was installed to doesn't have executable permissions, that could be it. (Python code can be executed from a disk/directory without executable permissions, but native machine code can't be, which can cause some surprises.)

When it comes to installation issues, I can only make guesses because your system is different than mine. We try to use standard installation procedures, so if you use the standard Python inhalation tools (pip, conda) then it ought to work without problems, but evidently that didn't happen here.

Jim Pivarski
  • 5,568
  • 2
  • 35
  • 47
  • Yes Jim I installed it using pip only and there was no issue during installation. – MSS Mar 26 '21 at 16:45
  • Try uninstalling it with pip (`python -m pip uninstall awkward` repeatedly until it says there's nothing to uninstall), then do it again with `-U` to ensure that you're getting the most up-to-date: `python -m pip install -U awkward`. The use of "`python -m pip`" instead of just `pip` ensures that it's installing for the Python executable that you use. Failing that, also consider that the disk or directory might not allow binary executables. Does any other Python extension module (i.e. written in C/C++) work? – Jim Pivarski Mar 26 '21 at 18:11
  • I couldn't find a way around this. Is it related to https://docs.python.org/3/whatsnew/3.8.html#bpo-36085-whatsnew . – MSS Mar 31 '21 at 04:29
  • I doubt it's related to `bpo-36085`: "The result is .pyd files that need to resolve .dll dependencies from directories *other* than where the .pyd file is located." You're not able to load _ext.pyd, which does not need to load any other .dlls, but even if it did, the other DLLs that are shipped with Awkward Array are in the same directory as the _ext.pyd. The description of this bug doesn't match what these libraries need to do. – Jim Pivarski Mar 31 '21 at 17:44