I'm writing an app that does Py_InitializeEx(0) and that ends up calling exit()
'irisdb.exe' (Win32): Loaded 'C:\Windows\System32\bcryptprimitives.dll'. Symbols loaded without source information.
Fatal Python error: failed to get the Python codec of the filesystem encoding
'irisdb.exe' (Win32): Loaded 'C:\Windows\System32\kernel.appcore.dll'. Symbols loaded without source information.
when I call PyInitializeEx(0) in the python39.dll that you ship.
My application works fine for conda which is based on python311/python311.dll now.
I'm not sure what I can change, this is basic embedded python.
Sorry for the delay, We analyzed the problem and encountered the same failure for both Miniconda for Python 3.9 and IDP for 3.9.
After our observation, we concluded that since you got it to work for Python 3.11 with conda, We'll give you the benefit of the doubt that it's a problem with Python 3.9, and has nothing to do with IDP.
Please let us know If you find further issues.
連結已複製
Hi Philip,
It appears that your application is functioning properly when using open-source Python 3.11, but encountering issues when using IntelPython 3.9. Please let me know if my understanding is wrong.
Please provide details about the operating system and steps to reproduce the issue.
zip file attached.
There are 2 visual studio simple projects: a Console App one and a DLL one.
There are 2 pythons you can use depending on an #if in the console project.
python.org 3.9, the working one results in this:
Hello World!
doing import numpy in dll:
hello from python
import done
C:\Users\pmilosla\source\repos\ConsoleApplication\x64\Release\ConsoleApplication.exe (process 16820) exited with code 0.
Press any key to close this window . . .
Your python results in this:
Hello World!
Python path configuration:
PYTHONHOME = (not set)
PYTHONPATH = (not set)
program name = 'python'
isolated = 0
environment = 1
user site = 1
import site = 1
sys._base_executable = 'C:\\Users\\pmilosla\\source\\repos\\ConsoleApplication\\x64\\Release\\ConsoleApplication.exe'
sys.base_prefix = 'C:\\ProgramData\\intelpython3'
sys.base_exec_prefix = 'C:\\ProgramData\\intelpython3'
sys.platlibdir = 'lib'
sys.executable = 'C:\\Users\\pmilosla\\source\\repos\\ConsoleApplication\\x64\\Release\\ConsoleApplication.exe'
sys.prefix = 'C:\\ProgramData\\intelpython3'
sys.exec_prefix = 'C:\\ProgramData\\intelpython3'
sys.path = [
'C:\\ProgramData\\intelpython3\\python39.zip',
'.\\DLLs',
'.\\lib',
'C:\\Users\\pmilosla\\source\\repos\\ConsoleApplication\\x64\\Release',
]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'
Current thread 0x00008e24 (most recent call first):
<no Python frame>
C:\Users\pmilosla\source\repos\ConsoleApplication\x64\Release\ConsoleApplication.exe (process 13100) exited with code 1.
Press any key to close this window . . .
Thank you for sharing the reproducible. We will keep you updated once we have any new information. Could you please provide us with more details about your environment, such as the version of Windows and Visual Studio that you are using?
Sorry for the delay, We analyzed the problem and encountered the same failure for both Miniconda for Python 3.9 and IDP for 3.9.
After our observation, we concluded that since you got it to work for Python 3.11 with conda, We'll give you the benefit of the doubt that it's a problem with Python 3.9, and has nothing to do with IDP.
Please let us know If you find further issues.