8000 Cannot init libpython3.5.so from dotnet core 2.0 in Ubuntu · Issue #565 · pythonnet/pythonnet · GitHub
[go: up one dir, main page]

Skip to content

Cannot init libpython3.5.so from dotnet core 2.0 in Ubuntu #565

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
karpovilia opened this issue Oct 25, 2017 · 6 comments
Closed

Cannot init libpython3.5.so from dotnet core 2.0 in Ubuntu #565

karpovilia opened this issue Oct 25, 2017 · 6 comments

Comments

@karpovilia
Copy link

Environment

  • Pythonnet version: latest master from github
  • Python version: 3.5 64-bit
  • Operating System: Ubuntu 16.04

Details

I'm trying to run simple c# test app (x64), which calls python "helloworld" script.
The code works perfectly in Windows Server 2008, but doesn't work in Ubuntu 16.04
I've added some Console.Writeline outputs. The library crushes in PythonEngine.Initialize() method.

dotnet PythonTest.dll
trying to load LoadLibrary + <<</usr/lib/python3.5/config-3.5m-x86_64-linux-gnu/libpython3.5.so>>>
dlopen /usr/lib/python3.5/config-3.5m-x86_64-linux-gnu/libpython3.5.so
resint = 0
Calling GetProcAddress, with parameters dllHandle = 0, and name = _PyObject_NextNotImplemented
look in the exe if dllHandle is NULL
Segmentation fault (core dumped)

Maybe I've used wrong conditional compilation symbols or RTLD_GLOBAL/RTLD_SHARED constants. Can you please write a list of conditional compilation symbols to compile the library for dotnet core 2.0 in Ubuntu or publish compiled library?

@den-run-ai
Copy link
Contributor

How did you install and why you cannot use Mono?

@dmitriyse
Copy link
Contributor
dmitriyse commented Oct 25, 2017

The problem relates to PYTHON_WITH_PYMALLOC constant.
Python.Runtime.dll should be compiled with PYTHON_WITH_PYMALLOC for libpython3.5m.so
And without this constant for libpython3.5.so

Currently under linux Python.Net was debugged only with libpython3.5m.so libraries

@dmitriyse
Copy link
Contributor

Please try to build Python.Net from scratch solely under linux. Probably some Windows builded files was used (from shared folder for example)

@den-run-ai
Copy link
Contributor

@dmitriyse doesn't setup.py detect PYTHON_WITH_PYMALLOC during installation?

@dmitriyse
Copy link
Contributor

I never faced in my practiace with the case when PYTHON_WITH_PYMALLOC was not detected.
Logic of PYTHON_WITH_PYMALLOC detection is exactly the same for the mono build and the xplat build

@filmor
Copy link
Member
filmor commented Nov 8, 2019

Closed in favour of #984, we will pass the library name more dynamically in the future which will resolve issues like this and similar problems.

@filmor filmor closed this as completed Nov 8, 2019
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

4 participants
0