Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xloil python init failed #104

Open
huche6 opened this issue Jun 10, 2024 · 3 comments
Open

xloil python init failed #104

huche6 opened this issue Jun 10, 2024 · 3 comments

Comments

@huche6
Copy link

huche6 commented Jun 10, 2024

I am trying to use xloil to work with a 32-bit Excel version.
I downloaded in a virtual env python3.10 in a 32-bit version and installed xloil.
When I'm trying to run Excel, I am getting the following error:

[2024-06-10 14:34:31.528] [logger] [debug] [Main.cpp:299] Python importing xloil
[2024-06-10 14:34:31.534] [logger] [error] [Main.cpp:408] xloil_python_init failed: ImportError: ImportError: DLL load failed while importing _ctypes: The specified module cannot be found.
Traceback (most recent call last):
  File "C:\Users\Hugo\micromamba\envs\xloil0\lib\site-packages\xloil\__init__.py", line 2, in <module>
    from ._core import *
  File "C:\Users\Hugo\micromamba\envs\xloil0\lib\site-packages\xloil\_core.py", line 19, in <module>
    env_vars = _get_environment_strings()
  File "C:\Users\Hugo\micromamba\envs\xloil0\lib\site-packages\xloil\_paths.py", line 46, in _get_environment_strings
    import ctypes
  File "C:\Users\Hugo\micromamba\envs\xloil0\lib\ctypes\__init__.py", line 8, in <module>
    from _ctypes import Union, Structure, Array
ImportError: DLL load failed while importing _ctypes: The specified module cannot be found.

The weird part is, if I activate my environnement and open a python consol, I can perform the faulty commands without problem. Do you have an idea from where the problem could come ?

I am working with:
32-bits Excel in Microsoft 365 Apps for enterprise
Python 3.10.4 in 32-bits
xloil 0.18.3
Windows 10

Great work for Xloil and thank you in advance !

P.S. It works without any problem with everything in 64-bits, I just have to use 32-bits version for a precise reason

@cunnane
Copy link
Owner

cunnane commented Jun 12, 2024

Could you check where _ctypes.pyd lives in your python distribution? It's normally in the DLLs directory. I suspect that certain environment paths aren't getting correctly set because you're using an environment different from the standard one or anaconda. xlOil should be able to cope with different environments, so I just want to establish what's going on.

@huche6
Copy link
Author

huche6 commented Jun 12, 2024

Thank you for your answer.
The _ctypes.pyd is in the DLLs directory

@cunnane
Copy link
Owner

cunnane commented Jun 24, 2024

Could you try adding the path to the DLLs directory to your PYTHONPATH in your xloil.ini?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants