This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author piyush115
Recipients piyush115
Date 2021-02-27.19:08:58
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1614452939.17.0.0398730160049.issue43342@roundup.psfhosted.org>
In-reply-to
Content
Hi,
I am facing a very strange issue.
I am working on a C++ application which embeds a python.
As per documentation i have the dependencies added from python (/libs and /include directories) to C++ application.
I am using Py_RunString() to run simple python code.

Python code is simple:

import os
def Func():
    return 10.0

The application run smoothly when i have python installation in directory like 
"C:\PythonXY\"

but if python installation is in directory like "C:\MyPython\" or default installation path AppData\local\program\python\pythonxy\ , python code errors out.

the error i am getting is "__import__ not found".

I have used PyErr_Fetch to retrieve error.

It's really strange that the python installation directory affects how Python  code is run.

It seems it have a problem running "import os" statement or any "import" statement.


Could you help me how i can resolve this issue? 

Thanks,
Piyush
History
Date User Action Args
2021-02-27 19:08:59piyush115setrecipients: + piyush115
2021-02-27 19:08:59piyush115setmessageid: <1614452939.17.0.0398730160049.issue43342@roundup.psfhosted.org>
2021-02-27 19:08:59piyush115linkissue43342 messages
2021-02-27 19:08:58piyush115create