Hello Python-win32 mailing list:

I just figured out my problem and wanted to share for anyone else. On a normal install of Python 3.12 using pip to install pywin32 I was getting "servicemanager.__file__ could not be loaded " pretty much no matter what I did. The message in event viewer was "RuntimeError: servicemanager.__file__ could not be loaded - win32 error code is 193 ".


After adding everything to the System Paths I eventually got an error message indicating could not load from "c:\program" on the command line. Which lead to a memory I have of why I always installed python to c:\python312 ( or whatever ). I uninstalled python, reinstalled it to the directory without spaces and everything works great.

I don't know if it is PythonService.cpp isn't parsing the space in here:

    Py_Initialize();
    module = PyImport_ImportModule("servicemanager");
    if (!module)
        goto failed;
    f = PyObject_GetAttrString(module, "__file__");
    Py_DECREF(module);
    if (!f)
        goto failed;

or if it's somewhere in the ServiceManger.pyd. I'm not entirely sure how to track down where it's not parsing the space, but this is a good work around.

Lee Duncan
_______________________________________________
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32

Reply via email to