Page 1 of 1

Project does not load under Win11

Posted: 15.03.2023 20:18
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.

Posted: 15.03.2023 21:57
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?

Posted: 16.03.2023 06:10
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

Posted: 16.03.2023 06:48
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

Posted: 16.03.2023 06:51
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

Posted: 16.03.2023 07:45
by Stefan
Thank you. This solved the problem. Both solutions work, I kept the second (longer) code that you provided.