You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, the code doesn't run on my machine, anyone happens to have a clue? really appreciated.
It's PythonEngine.Initialize() failed on Py_Initialize() call, exit code 1 with no further error message. I checked python27.dll is in c:\windows\system32.
The machine is windows 10, python 2.7.11 64bit, visual studio 2015 community. I'm trying to run the embedding test, calling python from C#. VS configuration is switched to DebugWin x64.
Hi denfromufa, I followed your FAQ steps. I piped pythonnet and I can see this subfolder under \site-packages, which also contains clr.pyd and python.runtime.dll. Then I tried three winforms in \pythonnet-develop\demo all went through successfully.
I have to copy Python.Test.dll to pythonnet-develop\src\tests in order to run python pythonnet\src\tests\runtests.py. There are four failures in MethodTest, complaining no method matches given arguments. But I believe other tests went through.
Now it comes to the part I'm most interested. The console project still doesn't work. It exits on PythonEngine.Initialize() call with no error message. Just jumps out. Do you have suggestions on how to proceed? Thanks.
By console app, I assume you mean nPython.exe? try starting it up from command line (cmd or ps) and see if you get exception and traceback with debug build of console app? I do not have windows 10 machine ready to confirm your problem. also might worth running embedding tests, which I updated in FAQ troubleshooting.
4 failing tests in MethodTest is not normal.
BTW, you do not have to use nPython for pythonnet. You can import clr from regular cpython interpreter or ipython.
Sounds like Python's not able to find where the python packages are
installed to me. If you enable debug logging it might tell you what's going
wrong (try setting PYTHONDEBUG and PYTHONVERBOSE environment variables).
Depending on how python's installed it might not find the python install
(if it's not installed as the default Python for example). You should try
setting PYTHONHOME.
See https://docs.python.org/2/using/cmdline.html (towards the end, at the
environment variable section) for details. You can also set PYTHONHOME
programmatically before initializing Python if that is the problem.
By console app, I assume you mean nPython.exe? try starting it up from
command line (cmd or ps) and see if you get exception and traceback with
debug build of console app? I do not have windows 10 machine ready to
confirm your problem. also might worth running embedding tests, which I
updated in FAQ troubleshooting.
4 failing tests in MethodTest is not normal.
BTW, you do not have to use nPython for pythonnet. You can import clr
from regular cpython interpreter or ipython.
—
Reply to this email directly or view it on GitHub #156 (comment)
.
@tonyroberts@letianzj there are 2 issues with python 2.7.11 windows installer from python.org, looks like others are hitting this issue also. I spent few hours debugging this until upgrading to anaconda.
Activity
den-run-ai commentedon Feb 19, 2016
When you built pythonnet from VS, did you install it to site-packages? What exception and traceback do you get?
den-run-ai commentedon Feb 19, 2016
here is troubleshooting FAQ page to start with:
https://github.com/denfromufa/pythonnet/wiki/Troubleshooting-FAQ
letianzj commentedon Feb 21, 2016
Hi denfromufa, I followed your FAQ steps. I piped pythonnet and I can see this subfolder under \site-packages, which also contains clr.pyd and python.runtime.dll. Then I tried three winforms in \pythonnet-develop\demo all went through successfully.
I have to copy Python.Test.dll to pythonnet-develop\src\tests in order to run python pythonnet\src\tests\runtests.py. There are four failures in MethodTest, complaining no method matches given arguments. But I believe other tests went through.
Now it comes to the part I'm most interested. The console project still doesn't work. It exits on PythonEngine.Initialize() call with no error message. Just jumps out. Do you have suggestions on how to proceed? Thanks.
den-run-ai commentedon Feb 21, 2016
By console app, I assume you mean nPython.exe? try starting it up from command line (cmd or ps) and see if you get exception and traceback with debug build of console app? I do not have windows 10 machine ready to confirm your problem. also might worth running embedding tests, which I updated in FAQ troubleshooting.
4 failing tests in MethodTest is not normal.
BTW, you do not have to use nPython for pythonnet. You can
import clrfrom regular cpython interpreter or ipython.tonyroberts commentedon Feb 21, 2016
Sounds like Python's not able to find where the python packages are
installed to me. If you enable debug logging it might tell you what's going
wrong (try setting PYTHONDEBUG and PYTHONVERBOSE environment variables).
Depending on how python's installed it might not find the python install
(if it's not installed as the default Python for example). You should try
setting PYTHONHOME.
See https://docs.python.org/2/using/cmdline.html (towards the end, at the
environment variable section) for details. You can also set PYTHONHOME
programmatically before initializing Python if that is the problem.
regards,
Tony
On Sun, Feb 21, 2016 at 5:05 PM denfromufa notifications@github.com wrote:
den-run-ai commentedon Apr 13, 2016
@tonyroberts @letianzj there are 2 issues with python 2.7.11 windows installer from python.org, looks like others are hitting this issue also. I spent few hours debugging this until upgrading to anaconda.
http://stackoverflow.com/questions/36603052/pythonengine-initialize-fails-without-any-error-message
den-run-ai commentedon Sep 7, 2016
closing this issue, since python 2.7.12 was released with fixes to embedding paths.