8000 Embedding test failed · Issue #156 · pythonnet/pythonnet · GitHub
[go: up one dir, main page]

Skip to content

Embedding test failed #156

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
letianzj opened this issue Feb 18, 2016 · 7 comments
Closed

Embedding test failed #156

letianzj opened this issue Feb 18, 2016 · 7 comments

Comments

@letianzj
Copy link

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.

@den-run-ai
Copy link
Contributor

When you built pythonnet from VS, did you install it to site-packages? What exception and traceback do you get?

@den-run-ai
Copy link
Contributor

here is troubleshooting FAQ page to start with:

https://github.com/denfromufa/pythonnet/wiki/Troubleshooting-FAQ

@letianzj
Copy link
Author

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
Copy link
Contributor

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.

@tonyroberts
Copy link
Contributor

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:

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)
.

@den-run-ai
Copy link
Contributor

@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
Copy link
Contributor

closing this issue, since python 2.7.12 was released with fixes to embedding paths.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
0