Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem in Py_Initialize
#3
Thanks for your answer.

This morning I have looked more deeply for the cause of my problem and I have followed the idea that consists in comparing the debug of python_d.exe initialization and the one of my test project. It results that initialization needs stuff in PYTHONHOME\Lib to succeed. In my case, the calculate_path function does not encounter any PYTHONHOME content and consider that the encodings files are in ".\Lib" but I have not such a folder in my executable path that explains why I had the error (for python_d.exe, the executable is in an official Python folder tree, and calculate_path() considers that the Lib folder is there, and it is ! so it's working)

Solution I have set up : If no PYTHONHOME is defined, I define it with my executable path after having checked that there is a Lib\extensions folder in it. At install time, I'll deliver in .\Lib and .\Lib extensions the minimum files required to initialize correctly with Py_Initialize().

Hope this can help  Shy ,

Julien
Reply


Messages In This Thread
Problem in Py_Initialize - by SmithPython - Mar-06-2017, 04:01 PM
RE: Problem in Py_Initialize - by Larz60+ - Mar-06-2017, 04:08 PM
RE: Problem in Py_Initialize - by SmithPython - Mar-07-2017, 02:25 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Fatal Python error: Py_Initialize: unable to load the file system codec ecg1g15 0 3,624 Feb-12-2019, 12:16 PM
Last Post: ecg1g15
  Py_Initialize Crash with Python 3.6 paulhbm 0 4,441 Sep-20-2018, 09:56 AM
Last Post: paulhbm

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020