Closed alpxpatx closed 2 years ago
It seems that there is something for python 3.8 and 3.9 that makes it not work on Windows. I am sure there is something in the setup.py
that can be changed to fix this, but I honestly don't know how to.
My suggestions: install a python virtual environment for python 3.7 and get TIGRE there.
Or if you have any idea how to fix this, do let me know!
Hi there,
are there any news on this topic? Unfortunately, I have the same problem. Tigre runs fine with Python 3.7, but using 3.8, 3.9 or 3.10 compiling works fine, but the import fails with the following message:
`Python 3.9.12 | packaged by conda-forge | (main, Mar 24 2022, 23:17:03) [MSC v.1929 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information.
import tigre Traceback (most recent call last): File "
", line 1, in File "C:\Users*\Documents\xray_simulation\TIGRE\Python\tigre__init__.py", line 4, in from .utilities.Ax import Ax File "C:\Users* \Documents\xray_simulation\TIGRE\Python\tigre\utilities\Ax.py", line 4, infrom _Ax import _Ax_ext ImportError: DLL load failed while importing _Ax: Das angegebene Modul wurde nicht gefunden.`
The last sentence means basically module not found
. A workaround would be highly appreciated since another package I'm using doesn't support 3.7 anymore.
Thanks a lot and cheers!
Hi @broooooot ,
Unfortunately my python is not good enough to know why this is happening. It seems like when compiled with python 3.8 or higher, the compiled object (DLL) is not found anymore when trying to run the code. This means that something in Setup.py doesn't really work well, but I have no idea what. Let me dig a bit to see if I can fix that....
@broooooot try pip install .
Alternatively, I think it works well in a conda enviroment, but I have not tried it myself.
Hint to fix:
https://docs.python.org/3.8/library/os.html#os.add_dll_directory
New in version 3.8: Previous versions of CPython would resolve DLLs using the default behavior for the current process. This led to inconsistencies, such as only sometimes searching PATH or the current working directory, and OS functions such as AddDllDirectory having no effect.
https://docs.python.org/3.8/whatsnew/3.8.html#bpo-36085-whatsnew
Can't try now, but it seems that we may need to explicitly load the dlls somewhere in the __init__
Hi @AnderBiguri and thank you for your response,
I will have a look into that matter and try to figure something out. Actually, I am using a conda environment but for some reason I am not able to use pip install .
because then the installer can't find Cython
, though of course it is installed in the environment. Instead, I'm installing TIGRE via python setup.py install
which works. Maybe that might even be the cause of the problem. Thanks again, hopefully you'll find something. In the meantime I'm trying to make everything work using wsl and ubuntu ..
Cheers!
Closing this from lack of response, but feel free to reopen it if you still have this issues.
Code to reproduce the problem (If applicable) running following on windows 10 cmd line
C:\Users\Admin\TIGRE\Python\demos>python d01_CreateGeometry.py
output Traceback (most recent call last): File "d01_CreateGeometry.py", line 25, in
import tigre
File "C:\Users\Admin\AppData\Roaming\Python\Python38\site-packages\pytigre-2.1.0-py3.8-win-amd64.egg\tigre__init__.py", line 4, in
from .utilities.Ax import Ax
File "C:\Users\Admin\AppData\Roaming\Python\Python38\site-packages\pytigre-2.1.0-py3.8-win-amd64.egg\tigre\utilities\Ax.py", line 4, in
from _Ax import _Ax_ext
ImportError: DLL load failed while importing _Ax: The specified module could not be found.