Repository navigation
ImportError when using dolfinx in PythonCall #729
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Activity
The issue somehow disappeared when I started from a clean environment, I'm not able to reproduce it anymore...
I'm having a similar issue, but only when using Ubuntu WSL. It works fine on Windows, but when I try running the same script on WSL I get the error:
julia> pyimport("fundus_image_toolbox") ERROR: Python: OSError: libmkl_gnu_thread.so.2: cannot open shared object file: No such file or directory Python stacktrace: [1] __init__ @ ctypes /mnt/d/projects/FOCAL/.CondaPkg/.pixi/envs/default/lib/python3.12/ctypes/__init__.py:379 [2] _load_global_deps @ /mnt/d/projects/FOCAL/.CondaPkg/.pixi/envs/default/lib/python3.12/site-packages/torch/__init__.py:366 [3] _preload_cuda_deps @ /mnt/d/projects/FOCAL/.CondaPkg/.pixi/envs/default/lib/python3.12/site-packages/torch/__init__.py:344 [4] _load_global_deps @ /mnt/d/projects/FOCAL/.CondaPkg/.pixi/envs/default/lib/python3.12/site-packages/torch/__init__.py:388 [5] <module> @ /mnt/d/projects/FOCAL/.CondaPkg/.pixi/envs/default/lib/python3.12/site-packages/torch/__init__.py:430 [6] <module> @ /mnt/d/projects/FOCAL/.CondaPkg/.pixi/envs/default/lib/python3.12/site-packages/fundus_image_toolbox/circle_crop/eyeq_preprocess.py:2 [7] <module> @ /mnt/d/projects/FOCAL/.CondaPkg/.pixi/envs/default/lib/python3.12/site-packages/fundus_image_toolbox/circle_crop/__init__.py:1 [8] <module> @ /mnt/d/projects/FOCAL/.CondaPkg/.pixi/envs/default/lib/python3.12/site-packages/fundus_image_toolbox/__init__.py:1 Stacktrace: [1] pythrow() @ PythonCall.Core ~/.julia/packages/PythonCall/83z4q/src/Core/err.jl:77 [2] errcheck @ ~/.julia/packages/PythonCall/83z4q/src/Core/err.jl:10 [inlined] [3] pyimport(m::String) @ PythonCall.Core ~/.julia/packages/PythonCall/83z4q/src/Core/builtins.jl:1458 [4] top-level scope @ REPL[7]:1This is what my CondaPkg.toml looks like:
[deps] pytorch = "" numpy = "" stringzilla = "" [pip.deps] fundus_image_toolbox = ""I've tried adding the mkl packages to CondaPkg.toml, as well as fixing a python version (3.12), but none of those attempts solved the issue. However, if I run
julia> using CondaPkg pkg> conda run python >>> import fundus_image_toolbox as fit Module missing, downloading it from https://github.com/berenslab/MIDL24-segmentation_quality_control... Adjusting imports... Done. Module missing, downloading it from https://github.com/dsc/bunch... >>> fit.__file__ '/mnt/d/projects/FOCAL/.CondaPkg/.pixi/envs/default/lib/python3.12/site-packages/fundus_image_toolbox/__init__.py' >>>it works. I've also looked at .CondaPkg, at the file
libmkl_gnu_thread.so.2is there, so I'm not sure what the issue could be (.CondaPkg/.pixi/envs/default/lib/libmkl_intel_thread.so.2)
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Affects: PythonCall
Describe the bug
What's strange is
works fine
Your system
Ubuntu 24.04, Julia 1.12.1, PythonCall 0.9.30. Python and Conda managed by CondaPkg (default environment).