Project does not load under Win11

Solved bugs are moved into this topic...
Post Reply
Stefan
Posts: 112
Joined: 06.10.2012 15:06

Project does not load under Win11

Post by Stefan »

Working portable from stick, my projects do not load under Win 11, even though I run the exact same Cuda settings/folders as on other Win versions.
Loading project: D:\Toolbox\CudaText\settings\Cuda_Settings.cuda-proj
Traceback (most recent call last):
File "D:\Toolbox\CudaText\py\cuda_project_man\__init__.py", line 782, in action_open_project
self.action_refresh()
File "D:\Toolbox\CudaText\py\cuda_project_man\__init__.py", line 642, in action_refresh
self.action_refresh_int(parent)
File "D:\Toolbox\CudaText\py\cuda_project_man\__init__.py", line 703, in action_refresh_int
elif self.options.get("no_hidden", True) and is_hidden(spath):
File "D:\Toolbox\CudaText\py\cuda_project_man\__init__.py", line 139, in is_hidden
return is_hidden_win32(s)
File "D:\Toolbox\CudaText\py\cuda_project_man\__init__.py", line 123, in is_hidden_win32
import ctypes # import here to avoid it on Unix
File "<frozen zipimport>", line 259, in load_module
File "ctypes\__init__.py", line 7, in <module>
ImportError: DLL load failed while importing _ctypes: %1 ist keine zulässige Win32-Anwendung.
ERROR: Exception in CudaText for action_open_project: ImportError: DLL load failed while importing _ctypes: %1 ist keine zulässige Win32-Anwendung.
main Alexey
Posts: 2265
Joined: 25.08.2021 18:15

Post by main Alexey »

File "ctypes\__init__.py", line 7, in <module>
Error means - internal python error, maybe 'ctypes' module is not full? Do you have same versions of Python on both PCs? if yes, did you try to install different Python package (from Addons Manager, category 'packages')? I mean change 3.8 to 3.9 or 3.10 or 3.11?
Stefan
Posts: 112
Joined: 06.10.2012 15:06

Post by Stefan »

I do not know what Python versions were installed on the other machines. Where Cuda works fine. On the current machine, I installed Python 3.11, but the problem persists.

Trying to run Addons-Manager > Install brings up this error message:
Addons_fail.jpg
main Alexey
Posts: 2265
Joined: 25.08.2021 18:15

Post by main Alexey »

Error "because the SSL module" means python cannot find OpenSSL library.
here it's discussed: https://stackoverflow.com/questions/630 ... -available

you can change the Project Manager code: file py/cuda_project_man/__init__.py,
find:

Code: Select all

def is_hidden_win32(s):
replace function with:

Code: Select all

def is_hidden_win32(s):
    return False
main Alexey
Posts: 2265
Joined: 25.08.2021 18:15

Post by main Alexey »

I changed function now to:

Code: Select all

def is_hidden_win32(s):
    try:
        # import here to avoid it on Unix
        import ctypes
    except (ImportError, ModuleNotFoundError):
        return False
    try:
        attrs = ctypes.windll.kernel32.GetFileAttributesW(s)
        assert attrs != -1
        res = bool(attrs & 2)
    except (AttributeError, AssertionError):
        res = False
    return res
Stefan
Posts: 112
Joined: 06.10.2012 15:06

Post by Stefan »

Thank you. This solved the problem. Both solutions work, I kept the second (longer) code that you provided.
Post Reply