Imath: ImportError: DLL load failed while importing imath in Python 3.9

Hi,

I have a puzzling exception being raised while trying to build with Python 3.9 on Windows:

> C:\Users\tmansencal>python
Python 3.9.10 (tags/v3.9.10:f2f3f53, Jan 17 2022, 15:14:21) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import imath
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: DLL load failed while importing imath: The specified module could not be found.

Naturally, I looked at the dependencies and besides the fact I’m using the VFX Reference Platform 2022 variants, everything seems in order:

image

The only missing DLL I can see for both versions is ext-ms-win-oobe-query-l1-1-0.dll but I don’t think it is the issue here.

Any idea on how I could investigate this some more?

Configure

[tasks] Configure command: call vcvarsall.bat amd64 && cd /d "[...]\imath\build\platform-windows\arch-AMD64\msvc-19.1\python-3.9\imath" && cmake [...]\imath\imath -DPYTHON=ON -G "Visual Studio 15 2017 Win64"  -T v141,host=x64
**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.0
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'
-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19043.
-- The C compiler identification is MSVC 19.16.27045.0
-- The CXX compiler identification is MSVC 19.16.27045.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - not found
-- Found Threads: TRUE
-- Configure Imath 3.1.2, library API version: 29.1.0
-- pkg-config generation disabled
-- Looking for sin in m
-- Looking for sin in m - not found
-- Found Python: C:/Program Files/Python39/python.exe (found version "3.9.10") found components: Interpreter Development Development.Module Development.Embed
-- Found Python3: C:/Program Files/Python39/python.exe (found version "3.9.10") found components: Interpreter Development Development.Module Development.Embed
-- : Found Python 3.9.10
-- Found Python3 libraries: 39
--   -> Will install to: Lib/site-packages
-- Disabling boost-provided cmake config. If this causes problems, consider setting Boost_NO_BOOST_CMAKE variable to OFF
-- Found Boost: [...]/boost/1.76.0.rf1/platform-windows/arch-AMD64/msvc-19.1/python-3.9/boost (found version "1.76.0") found components: python39 missing components: python python3
--  -> Found Python 3 boost: Boost::python39
-- Found NumPy 1.20.3 for Python 3.9.10: [...]/numpy/1.20.3.rf1/platform-windows/arch-AMD64/msvc-19.1/python-3.9/numpy/numpy/core/include
-- pkg-config generation disabled
-- clang-format not found.
-- Configuring done
-- Generating done
-- Build files have been written to: [...]/imath/build/platform-windows/arch-AMD64/msvc-19.1/python-3.9/imath

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 17 (8 by maintainers)

Most upvoted comments

Is it possibly related to the new os.add_dll_directory scheme, which was added only to Windows Python recently? It consistently broke C++ based Python projects that have dlls.

You can see notes about it in the USD repo -

https://github.com/PixarAnimationStudios/USD/search?q=add_dll_directory