bluescarni / heyoka.py

Python library for ODE integration via Taylor's method and LLVM
Mozilla Public License 2.0
70 stars 9 forks source link

[BUG] DLL load failed when import heyoka on Windows 11 #199

Open TheoVerhelst opened 1 week ago

TheoVerhelst commented 1 week ago

Describe the bug Importing heyoka raises an error on Windows 11:

>>> import heyoka
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\theo.verhelst\AppData\Local\miniconda3\envs\myenv\Lib\site-packages\heyoka\__init__.py", line 48, in <module>
    from .core import *
ImportError: DLL load failed while importing core: The specified module could not be found.

I obtained this same bug with Python 3.10, 3.11, 3.12, and Heyoka 5.1 and 6.0. My colleague with a similar Windows machine has the same issue. I tried reinstalling miniconda, and also I tried the same procedure with miniforge and mamba, with the same outcome. I see that the Windows package of Heyoka is built with Visual Studio 17 2022, maybe the missing DLL is given by VS17? (I cannot install it since I do not have admin rights on my machine).

To Reproduce Steps to reproduce the behavior:

 $ conda create -n myenv python=3.11
 $ conda activate myenv
 $ conda config --add channels conda-forge
 $ conda config --set channel_priority strict
 $ conda install heyoka.py
 $ python
 >>> import heyoka

Screenshot The following screenshot from the Dependency Walker (from https://github.com/lucasg/Dependencies) applied to C:\Users\theo.verhelst\AppData\Local\miniconda3\envs\myenv\Lib\site-packages\heyoka\core.cp311-win_amd64.pyd might be relevant: image

Environment (please complete the following information):

isuruf commented 1 week ago

Can you do conda list in myenv?

TheoVerhelst commented 1 week ago

Sure:

> conda list
# packages in environment at C:\Users\theo.verhelst\miniforge3\envs\myenv:
#
# Name                    Version                   Build  Channel
arb                       2.23.0               h2694639_0    conda-forge
bzip2                     1.0.8                h2466b09_7    conda-forge
ca-certificates           2024.8.30            h56e8100_0    conda-forge
cloudpickle               3.0.0              pyhd8ed1ab_0    conda-forge
fmt                       11.0.2               h7f575de_0    conda-forge
heyoka                    6.1.0                h8eaf537_0    conda-forge
heyoka.py                 6.1.2           py311h22abefe_0    conda-forge
intel-openmp              2024.2.1          h57928b3_1083    conda-forge
libblas                   3.9.0              24_win64_mkl    conda-forge
libboost                  1.86.0               h444863b_2    conda-forge
libcblas                  3.9.0              24_win64_mkl    conda-forge
libexpat                  2.6.3                he0c23c2_0    conda-forge
libffi                    3.4.2                h8ffe710_5    conda-forge
libflint                  2.9.0           h448d227_nontl_0    conda-forge
libhwloc                  2.11.1          default_h8125262_1000    conda-forge
libiconv                  1.17                 hcfcfb64_2    conda-forge
liblapack                 3.9.0              24_win64_mkl    conda-forge
libsqlite                 3.46.1               h2466b09_0    conda-forge
libxml2                   2.12.7               h0f24e4e_4    conda-forge
libzlib                   1.3.1                h2466b09_2    conda-forge
mkl                       2024.1.0           h66d3029_694    conda-forge
mpc                       1.3.1                h4ff82f8_0    conda-forge
mpfr                      4.2.1                h64bf75a_1    conda-forge
mpir                      3.0.0             he025d50_1002    conda-forge
mpmath                    1.3.0              pyhd8ed1ab_0    conda-forge
mppp                      1.0.4                he786bba_0    conda-forge
numpy                     1.26.4          py311h0b4df5a_0    conda-forge
openssl                   3.3.2                h2466b09_0    conda-forge
pip                       24.2               pyh8b19718_1    conda-forge
pthreads-win32            2.9.1                h2466b09_4    conda-forge
pybind11-abi              4                    hd8ed1ab_3    conda-forge
python                    3.11.10         hce54a09_2_cpython    conda-forge
python_abi                3.11                    5_cp311    conda-forge
setuptools                75.1.0             pyhd8ed1ab_0    conda-forge
sleef                     3.7                  h7e360cc_0    conda-forge
spdlog                    1.14.1               h9f2357e_1    conda-forge
sympy                     1.13.3             pyh04b8f61_4    conda-forge
tbb                       2021.13.0            hc790b64_0    conda-forge
tk                        8.6.13               h5226925_1    conda-forge
tzdata                    2024b                hc8b5060_0    conda-forge
ucrt                      10.0.22621.0         h57928b3_1    conda-forge
vc                        14.3                h8a93ad2_22    conda-forge
vc14_runtime              14.40.33810         hcc2c482_22    conda-forge
vs2015_runtime            14.40.33810         h3bf8584_22    conda-forge
wheel                     0.44.0             pyhd8ed1ab_0    conda-forge
xz                        5.2.6                h8d14728_0    conda-forge
zstd                      1.5.6                h0ea2cb4_0    conda-forge
isuruf commented 1 week ago

Output of dir C:\Users\theo.verhelst\miniforge3\envs\myenv\Library\bin and echo %PATH%?

TheoVerhelst commented 1 week ago
>dir C:\Users\theo.verhelst\miniforge3\envs\myenv\Library\bin
 Volume in drive C is OSDisk
 Volume Serial Number is 8671-30FE

 Directory of C:\Users\theo.verhelst\miniforge3\envs\myenv\Library\bin

11/10/2024  15:31    <DIR>          .
11/10/2024  15:31    <DIR>          ..
06/05/2022  17:21            21,984 api-ms-win-core-console-l1-1-0.dll
06/05/2022  17:29            21,976 api-ms-win-core-console-l1-2-0.dll
06/05/2022  17:21            21,984 api-ms-win-core-datetime-l1-1-0.dll
06/05/2022  17:21            21,984 api-ms-win-core-debug-l1-1-0.dll
06/05/2022  17:21            21,976 api-ms-win-core-errorhandling-l1-1-0.dll
06/05/2022  17:21            21,992 api-ms-win-core-fibers-l1-1-0.dll
06/05/2022  17:21            26,088 api-ms-win-core-file-l1-1-0.dll
06/05/2022  17:21            21,976 api-ms-win-core-file-l1-2-0.dll
06/05/2022  17:22            21,976 api-ms-win-core-file-l2-1-0.dll
06/05/2022  17:21            21,984 api-ms-win-core-handle-l1-1-0.dll
06/05/2022  17:21            21,984 api-ms-win-core-heap-l1-1-0.dll
06/05/2022  17:21            21,984 api-ms-win-core-interlocked-l1-1-0.dll
06/05/2022  17:22            22,008 api-ms-win-core-libraryloader-l1-1-0.dll
06/05/2022  17:21            21,984 api-ms-win-core-localization-l1-2-0.dll
06/05/2022  17:21            21,976 api-ms-win-core-memory-l1-1-0.dll
06/05/2022  17:21            21,984 api-ms-win-core-namedpipe-l1-1-0.dll
06/05/2022  17:21            22,008 api-ms-win-core-processenvironment-l1-1-0.dll
06/05/2022  17:21            21,976 api-ms-win-core-processthreads-l1-1-0.dll
06/05/2022  17:21            21,976 api-ms-win-core-processthreads-l1-1-1.dll
06/05/2022  17:21            21,992 api-ms-win-core-profile-l1-1-0.dll
06/05/2022  17:21            21,984 api-ms-win-core-rtlsupport-l1-1-0.dll
06/05/2022  17:21            21,976 api-ms-win-core-string-l1-1-0.dll
06/05/2022  17:21            21,976 api-ms-win-core-synch-l1-1-0.dll
06/05/2022  17:22            21,976 api-ms-win-core-synch-l1-2-0.dll
06/05/2022  17:21            21,984 api-ms-win-core-sysinfo-l1-1-0.dll
06/05/2022  17:21            21,976 api-ms-win-core-timezone-l1-1-0.dll
06/05/2022  17:21            21,992 api-ms-win-core-util-l1-1-0.dll
06/05/2022  17:21            21,984 api-ms-win-crt-conio-l1-1-0.dll
06/05/2022  17:21            26,080 api-ms-win-crt-convert-l1-1-0.dll
06/05/2022  17:21            21,984 api-ms-win-crt-environment-l1-1-0.dll
06/05/2022  17:21            21,984 api-ms-win-crt-filesystem-l1-1-0.dll
06/05/2022  17:21            21,984 api-ms-win-crt-heap-l1-1-0.dll
06/05/2022  17:21            21,984 api-ms-win-crt-locale-l1-1-0.dll
06/05/2022  17:21            30,184 api-ms-win-crt-math-l1-1-0.dll
06/05/2022  17:21            30,176 api-ms-win-crt-multibyte-l1-1-0.dll
06/05/2022  17:21            75,232 api-ms-win-crt-private-l1-1-0.dll
06/05/2022  17:21            21,984 api-ms-win-crt-process-l1-1-0.dll
06/05/2022  17:21            26,104 api-ms-win-crt-runtime-l1-1-0.dll
06/05/2022  17:21            26,080 api-ms-win-crt-stdio-l1-1-0.dll
06/05/2022  17:22            26,072 api-ms-win-crt-string-l1-1-0.dll
06/05/2022  17:21            21,984 api-ms-win-crt-time-l1-1-0.dll
06/05/2022  17:21            22,000 api-ms-win-crt-utility-l1-1-0.dll
22/08/2022  17:02         4,025,344 arb-2.dll
03/09/2024  05:39            17,408 boost_atomic.dll
03/09/2024  05:39           109,056 boost_charconv.dll
03/09/2024  05:39            35,840 boost_chrono.dll
03/09/2024  05:23           109,056 boost_cobalt.dll
03/09/2024  05:23            55,296 boost_container.dll
03/09/2024  05:23            13,824 boost_context.dll
03/09/2024  05:23            77,312 boost_contract.dll
03/09/2024  05:23            19,456 boost_coroutine.dll
03/09/2024  05:23             9,728 boost_date_time.dll
03/09/2024  05:24            75,264 boost_fiber.dll
03/09/2024  05:24           159,232 boost_filesystem.dll
03/09/2024  05:25           299,008 boost_graph.dll
03/09/2024  05:25            77,824 boost_iostreams.dll
03/09/2024  05:25           295,936 boost_json.dll
03/09/2024  05:26           455,680 boost_locale.dll
03/09/2024  05:28           588,288 boost_log.dll
03/09/2024  05:28           696,832 boost_log_setup.dll
03/09/2024  05:29            33,280 boost_math_c99.dll
03/09/2024  05:29            33,280 boost_math_c99f.dll
03/09/2024  05:29            31,232 boost_math_c99l.dll
03/09/2024  05:29           161,280 boost_math_tr1.dll
03/09/2024  05:29           163,328 boost_math_tr1f.dll
03/09/2024  05:29           161,280 boost_math_tr1l.dll
03/09/2024  05:29            42,496 boost_nowide.dll
03/09/2024  05:34            56,832 boost_prg_exec_monitor.dll
03/09/2024  05:30            65,024 boost_process.dll
03/09/2024  05:30           348,672 boost_program_options.dll
03/09/2024  05:31            30,720 boost_random.dll
03/09/2024  05:31           225,792 boost_regex.dll
03/09/2024  05:32           215,040 boost_serialization.dll
03/09/2024  05:32            14,336 boost_stacktrace_from_exception.dll
03/09/2024  05:32            10,752 boost_stacktrace_noop.dll
03/09/2024  05:32            26,624 boost_stacktrace_windbg.dll
03/09/2024  05:32            25,088 boost_stacktrace_windbg_cached.dll
03/09/2024  05:32             9,728 boost_system.dll
03/09/2024  05:28            79,872 boost_thread.dll
03/09/2024  05:34            30,720 boost_timer.dll
03/09/2024  05:34            38,912 boost_type_erasure.dll
03/09/2024  05:34           512,000 boost_unit_test_framework.dll
03/09/2024  05:35           287,744 boost_url.dll
03/09/2024  05:36           843,776 boost_wave.dll
03/09/2024  05:32           154,112 boost_wserialization.dll
16/12/2023  01:20            11,776 charset.dll
28/04/2024  01:20           322,560 concrt140.dll
11/10/2024  15:30             7,189 c_rehash.pl
09/11/2021  22:16            25,600 ffi-8.dll
05/08/2022  08:05         7,675,904 flint-17.dll
07/08/2024  18:09           132,096 fmt.dll
30/11/2018  10:20           612,352 gmp.dll
10/10/2024  12:27       440,682,496 heyoka.dll
08/07/2024  20:00           272,896 hwloc-15.dll
08/07/2024  20:00            33,792 hwloc-annotate.exe
08/07/2024  20:00            39,424 hwloc-bind.exe
08/07/2024  20:00            44,032 hwloc-calc.exe
08/07/2024  20:00             4,389 hwloc-compress-dir
08/07/2024  20:00            13,312 hwloc-diff.exe
08/07/2024  20:00            23,040 hwloc-distrib.exe
08/07/2024  20:00            26,112 hwloc-gather-cpuid.exe
08/07/2024  20:00            51,712 hwloc-info.exe
08/07/2024  20:00           103,424 hwloc-ls.exe
08/07/2024  20:00            13,312 hwloc-patch.exe
16/12/2023  01:20           937,472 iconv.dll
20/02/2024  19:49        39,434,248 libblas.dll
14/07/2024  18:30            76,288 libbz2.dll
20/02/2024  19:49        39,434,248 libcblas.dll
04/09/2024  03:17         6,459,392 libcrypto-3-x64.dll
04/09/2024  03:17        18,264,064 libcrypto-3-x64.pdb
05/09/2024  22:41           402,432 libexpat.dll
20/02/2024  19:49            13,320 libimalloc.dll
11/07/2024  22:56         1,250,312 libiomp5md.dll
11/07/2024  22:56           123,912 libiomp5md_db.dll
11/07/2024  22:56            41,992 libiompstubs5md.dll
20/02/2024  19:49        39,434,248 liblapack.dll
13/08/2022  01:28           154,624 liblzma.dll
04/09/2024  03:17         1,247,744 libssl-3-x64.dll
04/09/2024  03:17         4,739,072 libssl-3-x64.pdb
15/07/2024  10:10         1,396,224 libxml2.dll
03/05/2024  09:59           654,336 libzstd.dll
08/07/2024  20:00           103,424 lstopo-no-graphics.exe
08/07/2024  20:00           111,104 lstopo-win.exe
08/07/2024  20:00           111,104 lstopo.exe
13/08/2022  01:28            18,944 lzmainfo.exe
20/02/2024  19:49        42,511,368 mkl_avx2.2.dll
20/02/2024  19:49        57,777,160 mkl_avx512.2.dll
20/02/2024  19:49           564,232 mkl_blacs_ilp64.2.dll
20/02/2024  19:49           137,736 mkl_blacs_intelmpi_ilp64.2.dll
20/02/2024  19:49           137,736 mkl_blacs_intelmpi_lp64.2.dll
20/02/2024  19:49           316,936 mkl_blacs_lp64.2.dll
20/02/2024  19:49           137,736 mkl_blacs_msmpi_ilp64.2.dll
20/02/2024  19:49           137,736 mkl_blacs_msmpi_lp64.2.dll
20/02/2024  19:49           406,024 mkl_cdft_core.2.dll
20/02/2024  19:49        75,978,760 mkl_core.2.dll
20/02/2024  19:49        37,350,920 mkl_def.2.dll
20/02/2024  19:49        37,564,424 mkl_intel_thread.2.dll
20/02/2024  19:49        43,294,728 mkl_mc3.2.dll
20/02/2024  19:49        44,169,224 mkl_pgi_thread.2.dll
20/02/2024  19:49        39,434,248 mkl_rt.2.dll
20/02/2024  19:49         7,775,752 mkl_scalapack_ilp64.2.dll
20/02/2024  19:49         7,762,952 mkl_scalapack_lp64.2.dll
20/02/2024  19:49        21,289,480 mkl_sequential.2.dll
20/02/2024  19:49        26,527,752 mkl_tbb_thread.2.dll
20/02/2024  19:49        15,734,792 mkl_vml_avx2.2.dll
20/02/2024  19:49        14,979,592 mkl_vml_avx512.2.dll
20/02/2024  19:49         8,425,480 mkl_vml_cmpt.2.dll
20/02/2024  19:49         9,359,368 mkl_vml_def.2.dll
20/02/2024  19:49        13,554,696 mkl_vml_mc3.2.dll
10/10/2024  09:59           154,112 mp++.dll
21/01/2023  03:30            99,328 mpc.dll
05/04/2024  20:15           515,072 mpfr-6.dll
05/04/2024  20:15           515,072 mpfr.dll
30/11/2018  10:20           612,352 mpir.dll
30/11/2018  10:20         4,009,984 mpir.pdb
30/11/2018  10:19           348,160 mpirxx_static.pdb
30/11/2018  10:19           167,936 mpir_static.pdb
28/04/2024  01:20           575,056 msvcp140.dll
28/04/2024  01:20            35,808 msvcp140_1.dll
28/04/2024  01:20           268,880 msvcp140_2.dll
28/04/2024  01:20            50,664 msvcp140_atomic_wait.dll
28/04/2024  01:20            31,744 msvcp140_codecvt_ids.dll
11/07/2024  22:56         1,275,400 omptarget.dll
11/07/2024  22:56         1,289,224 omptarget.rtl.level0.dll
11/07/2024  22:56         1,161,736 omptarget.rtl.opencl.dll
11/07/2024  22:56           939,528 omptarget.rtl.unified_runtime.dll
11/07/2024  22:56            22,024 omptarget.sycl.wrap.dll
04/09/2024  03:18           769,024 openssl.exe
04/09/2024  03:18         3,198,976 openssl.pdb
08/10/2024  17:19           715,776 pthreadVSE2.dll
18/09/2024  07:51         7,532,544 sleef.dll
18/09/2024  07:51         2,479,104 sleefquad.dll
18/09/2024  07:51           334,848 sleefscalar.dll
29/07/2024  09:33           271,872 spdlog.dll
03/09/2024  10:56         1,506,816 sqlite3.dll
05/09/2024  12:38           331,264 tbb12.dll
05/09/2024  12:38            23,040 tbbbind_2_5.dll
05/09/2024  12:38           112,640 tbbmalloc.dll
05/09/2024  12:38            31,232 tbbmalloc_proxy.dll
05/11/2023  18:36         1,829,888 tcl86t.dll
05/11/2023  18:36            70,656 tclsh.exe
05/11/2023  18:36            70,656 tclsh86.exe
05/11/2023  18:36            70,656 tclsh86t.exe
05/11/2023  18:37         1,552,896 tk86t.dll
06/05/2022  17:22         1,123,808 ucrtbase.dll
13/08/2022  01:28            20,480 unxz.exe
28/04/2024  01:20           408,144 vcamp140.dll
28/04/2024  01:20           351,824 vccorlib140.dll
28/04/2024  01:20           192,104 vcomp140.dll
28/04/2024  01:20           119,888 vcruntime140.dll
28/04/2024  01:20            49,640 vcruntime140_1.dll
28/04/2024  01:20            38,504 vcruntime140_threads.dll
05/11/2023  18:37            58,368 wish.exe
05/11/2023  18:37            58,368 wish86.exe
05/11/2023  18:37            58,368 wish86t.exe
15/07/2024  10:11            18,944 xmlcatalog.exe
15/07/2024  10:11            57,344 xmllint.exe
13/08/2022  01:28            66,560 xz.exe
13/08/2022  01:28           195,072 xz_static.exe
03/10/2024  15:51            89,088 zlib.dll
27/10/2022  13:52           134,656 zlib1.dll
03/05/2024  09:59           654,336 zstd.dll
03/05/2024  09:59           160,768 zstd.exe
             203 File(s)  1,158,398,762 bytes
               2 Dir(s)  894,621,458,432 bytes free
>echo %PATH%
C:\Users\theo.verhelst\miniforge3\envs\myenv;C:\Users\theo.verhelst\miniforge3\envs\myenv\Library\mingw-w64\bin;C:\Users\theo.verhelst\miniforge3\envs\myenv\Library\usr\bin;C:\Users\theo.verhelst\miniforge3\envs\myenv\Library\bin;C:\Users\theo.verhelst\miniforge3\envs\myenv\Scripts;C:\Users\theo.verhelst\miniforge3\envs\myenv\bin;C:\Users\theo.verhelst\miniforge3\condabin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Program Files\dotnet;C:\Program Files\Microsoft VS Code\bin;C:\Program Files\PuTTY;C:\Program Files\Git\cmd;C:\Users\theo.verhelst\AppData\Local\Microsoft\WindowsApps
TheoVerhelst commented 1 week ago

Also relevant, here is the full debug output of dlltracer when importing heyoka on another Windows machine suffering from the same issue: https://gist.github.com/TheoVerhelst/1e9caaf4e9b5dab8c0e7c39c01612155 Note the strange unicode errors after lines 980

bluescarni commented 6 days ago

@isuruf thanks for looking into this!

Any idea of what might be going on? I am totally stumped...