Skip to content

Add to docs a setup steps for Linux #241

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
zhukovgreen opened this issue Jul 19, 2016 · 26 comments
Closed

Add to docs a setup steps for Linux #241

zhukovgreen opened this issue Jul 19, 2016 · 26 comments

Comments

@zhukovgreen
Copy link

Hello, I was trying to setup PythonNet on my Linux machine and it was not easy for me. I have the next issue:

root@azh:~/Downloads/pythonnet-2.1.0# pip3 install pythonnet
The directory '/home/azh/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/azh/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting pythonnet
  Downloading pythonnet-2.1.0.zip (841kB)
    100% |████████████████████████████████| 849kB 1.2MB/s 
Installing collected packages: pythonnet
  Running setup.py install for pythonnet ... error
    Complete output from command /usr/bin/python3.5 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ropnhfme/pythonnet/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-j69ui9dw-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_ext
    Installing 'UnmanagedExports 1.2.6'.
    Installing 'NUnit 2.6.2'.
    Successfully installed 'NUnit 2.6.2'.
    Successfully installed 'UnmanagedExports 1.2.6'.
    /usr/bin/python3.5: can't open file 'tools/geninterop/geninterop.py': [Errno 2] No such file or directory
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-ropnhfme/pythonnet/setup.py", line 357, in <module>
        setup_requires=setup_requires
      File "/usr/lib/python3.5/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/usr/lib/python3.5/distutils/dist.py", line 955, in run_commands
        self.run_command(cmd)
      File "/usr/lib/python3.5/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/usr/local/lib/python3.5/dist-packages/setuptools/command/install.py", line 61, in run
        return orig.install.run(self)
      File "/usr/lib/python3.5/distutils/command/install.py", line 583, in run
        self.run_command('build')
      File "/usr/lib/python3.5/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/lib/python3.5/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/usr/lib/python3.5/distutils/command/build.py", line 135, in run
        self.run_command(cmd_name)
      File "/usr/lib/python3.5/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/lib/python3.5/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/usr/lib/python3.5/distutils/command/build_ext.py", line 338, in run
        self.build_extensions()
      File "/usr/lib/python3.5/distutils/command/build_ext.py", line 447, in build_extensions
        self._build_extensions_serial()
      File "/usr/lib/python3.5/distutils/command/build_ext.py", line 472, in _build_extensions_serial
        self.build_extension(ext)
      File "/tmp/pip-build-ropnhfme/pythonnet/setup.py", line 168, in build_extension
        _check_output([sys.executable, geninterop, interop_file])
      File "/tmp/pip-build-ropnhfme/pythonnet/setup.py", line 283, in _check_output
        raise CalledProcessError(retcode, cmd, output=output)
    subprocess.CalledProcessError: Command '['/usr/bin/python3.5', 'tools/geninterop/geninterop.py', 'src/runtime/interop35m.cs']' returned non-zero exit status 2

    ----------------------------------------
Command "/usr/bin/python3.5 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ropnhfme/pythonnet/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-j69ui9dw-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-ropnhfme/pythonnet/
root@azh:~/Downloads/pythonnet-2.1.0# exit
exit
azh@azh:~/Downloads/pythonnet-2.1.0$ 
azh@azh:~/Downloads/pythonnet-2.1.0$ pip install pythonnet
Collecting pythonnet
  Downloading pythonnet-2.1.0.zip (841kB)
    100% |████████████████████████████████| 849kB 1.1MB/s 
Installing collected packages: pythonnet
  Running setup.py install for pythonnet ... error
    Complete output from command /usr/bin/python3.5 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-jv9oykad/pythonnet/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-tshgkshh-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_ext
    Installing 'UnmanagedExports 1.2.6'.
    Installing 'NUnit 2.6.2'.
    Could not find a part of the path "/tmp/nuget/2bi76z0q.44m/license.txt".
    Could not find a part of the path "/tmp/nuget/58q8hn2f.z9m/lib/net/RGiesecke.DllExport.Metadata.dll".
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-jv9oykad/pythonnet/setup.py", line 357, in <module>
        setup_requires=setup_requires
      File "/usr/lib/python3.5/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/usr/lib/python3.5/distutils/dist.py", line 955, in run_commands
        self.run_command(cmd)
      File "/usr/lib/python3.5/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/usr/local/lib/python3.5/dist-packages/setuptools/command/install.py", line 61, in run
        return orig.install.run(self)
      File "/usr/lib/python3.5/distutils/command/install.py", line 583, in run
        self.run_command('build')
      File "/usr/lib/python3.5/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/lib/python3.5/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/usr/lib/python3.5/distutils/command/build.py", line 135, in run
        self.run_command(cmd_name)
      File "/usr/lib/python3.5/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/lib/python3.5/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/usr/lib/python3.5/distutils/command/build_ext.py", line 338, in run
        self.build_extensions()
      File "/usr/lib/python3.5/distutils/command/build_ext.py", line 447, in build_extensions
        self._build_extensions_serial()
      File "/usr/lib/python3.5/distutils/command/build_ext.py", line 472, in _build_extensions_serial
        self.build_extension(ext)
      File "/tmp/pip-build-jv9oykad/pythonnet/setup.py", line 122, in build_extension
        self._install_packages()
      File "/tmp/pip-build-jv9oykad/pythonnet/setup.py", line 231, in _install_packages
        check_call(cmd, shell=use_shell)
      File "/usr/lib/python3.5/subprocess.py", line 581, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command 'mono tools/nuget/nuget.exe restore pythonnet.sln -o packages' returned non-zero exit status 1

    ----------------------------------------
Command "/usr/bin/python3.5 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-jv9oykad/pythonnet/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-tshgkshh-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-jv9oykad/pythonnet/
@den-run-ai
Copy link
Contributor

In your case geninterop.py failed most likely because you are
missing pycparser, ply, or clang (in your path). We are not bundling
pre-generated interop35m.cs for Mono to be used in setup.py because
your python is build with a special abiflag --with-pymalloc (flag: m )

On Tue, Jul 19, 2016 at 8:33 AM, ZhukovGreen notifications@github.com
wrote:

Hello, I was trying to setup PythonNet on my Linux machine and it was not
easy for me. I have the next issue:

root@azh:~/Downloads/pythonnet-2.1.0# pip3 install pythonnet
The directory '/home/azh/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/azh/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting pythonnet
Downloading pythonnet-2.1.0.zip (841kB)
100% |████████████████████████████████| 849kB 1.2MB/s
Installing collected packages: pythonnet
Running setup.py install for pythonnet ... error
Complete output from command /usr/bin/python3.5 -u -c "import setuptools, tokenize;file='/tmp/pip-build-ropnhfme/pythonnet/setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /tmp/pip-j69ui9dw-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_ext
Installing 'UnmanagedExports 1.2.6'.
Installing 'NUnit 2.6.2'.
Successfully installed 'NUnit 2.6.2'.
Successfully installed 'UnmanagedExports 1.2.6'.
/usr/bin/python3.5: can't open file 'tools/geninterop/geninterop.py': [Errno 2] No such file or directory
Traceback (most recent call last):
File "", line 1, in
File "/tmp/pip-build-ropnhfme/pythonnet/setup.py", line 357, in
setup_requires=setup_requires
File "/usr/lib/python3.5/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib/python3.5/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/usr/lib/python3.5/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/usr/local/lib/python3.5/dist-packages/setuptools/command/install.py", line 61, in run
return orig.install.run(self)
File "/usr/lib/python3.5/distutils/command/install.py", line 583, in run
self.run_command('build')
File "/usr/lib/python3.5/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.5/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/usr/lib/python3.5/distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "/usr/lib/python3.5/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.5/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/usr/lib/python3.5/distutils/command/build_ext.py", line 338, in run
self.build_extensions()
File "/usr/lib/python3.5/distutils/command/build_ext.py", line 447, in build_extensions
self._build_extensions_serial()
File "/usr/lib/python3.5/distutils/command/build_ext.py", line 472, in _build_extensions_serial
self.build_extension(ext)
File "/tmp/pip-build-ropnhfme/pythonnet/setup.py", line 168, in build_extension
_check_output([sys.executable, geninterop, interop_file])
File "/tmp/pip-build-ropnhfme/pythonnet/setup.py", line 283, in _check_output
raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '['/usr/bin/python3.5', 'tools/geninterop/geninterop.py', 'src/runtime/interop35m.cs']' returned non-zero exit status 2

----------------------------------------

Command "/usr/bin/python3.5 -u -c "import setuptools, tokenize;file='/tmp/pip-build-ropnhfme/pythonnet/setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /tmp/pip-j69ui9dw-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-ropnhfme/pythonnet/
root@azh:/Downloads/pythonnet-2.1.0# exit
exit
azh@azh:
/Downloads/pythonnet-2.1.0$
azh@azh:~/Downloads/pythonnet-2.1.0$ pip install pythonnet
Collecting pythonnet
Downloading pythonnet-2.1.0.zip (841kB)
100% |████████████████████████████████| 849kB 1.1MB/s
Installing collected packages: pythonnet
Running setup.py install for pythonnet ... error
Complete output from command /usr/bin/python3.5 -u -c "import setuptools, tokenize;file='/tmp/pip-build-jv9oykad/pythonnet/setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /tmp/pip-tshgkshh-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_ext
Installing 'UnmanagedExports 1.2.6'.
Installing 'NUnit 2.6.2'.
Could not find a part of the path "/tmp/nuget/2bi76z0q.44m/license.txt".
Could not find a part of the path "/tmp/nuget/58q8hn2f.z9m/lib/net/RGiesecke.DllExport.Metadata.dll".
Traceback (most recent call last):
File "", line 1, in
File "/tmp/pip-build-jv9oykad/pythonnet/setup.py", line 357, in
setup_requires=setup_requires
File "/usr/lib/python3.5/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib/python3.5/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/usr/lib/python3.5/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/usr/local/lib/python3.5/dist-packages/setuptools/command/install.py", line 61, in run
return orig.install.run(self)
File "/usr/lib/python3.5/distutils/command/install.py", line 583, in run
self.run_command('build')
File "/usr/lib/python3.5/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.5/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/usr/lib/python3.5/distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "/usr/lib/python3.5/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.5/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/usr/lib/python3.5/distutils/command/build_ext.py", line 338, in run
self.build_extensions()
File "/usr/lib/python3.5/distutils/command/build_ext.py", line 447, in build_extensions
self._build_extensions_serial()
File "/usr/lib/python3.5/distutils/command/build_ext.py", line 472, in _build_extensions_serial
self.build_extension(ext)
File "/tmp/pip-build-jv9oykad/pythonnet/setup.py", line 122, in build_extension
self._install_packages()
File "/tmp/pip-build-jv9oykad/pythonnet/setup.py", line 231, in _install_packages
check_call(cmd, shell=use_shell)
File "/usr/lib/python3.5/subprocess.py", line 581, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'mono tools/nuget/nuget.exe restore pythonnet.sln -o packages' returned non-zero exit status 1

----------------------------------------

Command "/usr/bin/python3.5 -u -c "import setuptools, tokenize;file='/tmp/pip-build-jv9oykad/pythonnet/setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /tmp/pip-tshgkshh-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-jv9oykad/pythonnet/


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#241, or mute the thread
https://github.com/notifications/unsubscribe-auth/AHgZ5a_2THzqaekip3SH5F6KjlJFxF7aks5qXNIogaJpZM4JPurS
.

@tonyroberts
Copy link
Contributor

This looks like at least one of the problems:
/usr/bin/python3.5: can't open file 'tools/geninterop/geninterop.py': [Errno 2] No such file or directory

Perhaps there's a packaging issue where the wheel doesn't contain the tools...

You could try cloning the source from github and building from that instead ("python setup.py build")

Looks like there is also a problem with nuget. You should check the steps in the .travis.yml file and make sure you have done everything in there. It might be something like the certificates not having been installed.

@den-run-ai
Copy link
Contributor

@tonyroberts thanks for correcting me! Indeed I just downloaded the source
archive pythonnet-2.1.0 from PYPI and it does NOT bundle geninterop.py,
although nuget.exe is provided.

https://pypi.python.org/packages/b3/06/df4041021d83931ec3d963e782a05d115e99a0dd266cbedf408bda8840d5/pythonnet-2.1.0.zip#md5=4d4ca2ec11dc5e31c9aa142ed5f84a8e

On Tue, Jul 19, 2016 at 9:47 AM, Tony Roberts notifications@github.com
wrote:

This looks like at least one of the problems:
/usr/bin/python3.5: can't open file 'tools/geninterop/geninterop.py':
[Errno 2] No such file or directory

Perhaps there's a packaging issue where the wheel doesn't contain the
tools...

You could try cloning the source from github and building from that
instead ("python setup.py build")

Looks like there is also a problem with nuget. You should check the steps
in the .travis.yml file and make sure you have done everything in there. It
might be something like the certificates not having been installed.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#241 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AHgZ5eqvBNBccSp0LU32XToNpMNOiBZgks5qXON1gaJpZM4JPurS
.

@den-run-ai
Copy link
Contributor

perhaps we could also provide manylinux wheels:

https://github.com/pypa/manylinux

@zhukovgreen
Copy link
Author

zhukovgreen commented Aug 3, 2016

Thank you for help, I tried to manually install it from the latest release. The output is the following:

azh@azh:~/Downloads/pythonnet-master$ python setup.py build
running build
running build_ext
Installing 'NUnit 2.6.2'.
Installing 'UnmanagedExports 1.2.7'.
Successfully installed 'UnmanagedExports 1.2.7'.
Could not find a part of the path "/tmp/nuget/qmvio8vx.00a/license.txt".
Traceback (most recent call last):
  File "setup.py", line 358, in <module>
    setup_requires=setup_requires
  File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
    dist.run_commands()
  File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/usr/lib/python2.7/distutils/command/build.py", line 128, in run
    self.run_command(cmd_name)
  File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/usr/lib/python2.7/distutils/command/build_ext.py", line 339, in run
    self.build_extensions()
  File "/usr/lib/python2.7/distutils/command/build_ext.py", line 448, in build_extensions
    self.build_extension(ext)
  File "setup.py", line 125, in build_extension
    self._install_packages()
  File "setup.py", line 234, in _install_packages
    check_call(cmd, shell=use_shell)
  File "/usr/lib/python2.7/subprocess.py", line 541, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'mono tools/nuget/nuget.exe restore pythonnet.sln -o packages' returned non-zero exit status 1

Please advise

@den-run-ai
Copy link
Contributor

den-run-ai commented Aug 3, 2016

Here is the list of pre-requisites for installation on Linux:

https://github.com/pythonnet/pythonnet/blob/master/.travis.yml

and here is how typical build looks like on Travis CI for Linux:

https://travis-ci.org/pythonnet/pythonnet/jobs/148513880

@den-run-ai
Copy link
Contributor

btw, with git and pip you can just do this command after installing dependencies. No need to manually download the source code.

pip install git+https://github.com/pythonnet/pythonnet

@zhukovgreen
Copy link
Author

Hello,

I did everything in according with instruction. First thing I was needed to add was:
sudo apt install libglib2.0-dev without it I had an error during installation.

Another problem (the most mysterious one) is after running a test file:

root@azh:~/Downloads/pythonnet-master# python src/tests/runtests.py
Load clr import hook
* Assertion at sgen-alloc.c:558, condition `tlab_next_addr_offset != -1' not met


Native stacktrace:

    /usr/lib/libmonosgen-2.0.so.1(+0xcf1af) [0x7f1e6d10c1af]
    /lib/x86_64-linux-gnu/libpthread.so.0(+0x113d0) [0x7f1e6ef063d0]
    /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x38) [0x7f1e6eb61418]
    /lib/x86_64-linux-gnu/libc.so.6(abort+0x16a) [0x7f1e6eb6301a]
    /usr/lib/libmonosgen-2.0.so.1(+0x255019) [0x7f1e6d292019]
    /usr/lib/libmonosgen-2.0.so.1(+0x255227) [0x7f1e6d292227]
    /usr/lib/libmonosgen-2.0.so.1(+0x255376) [0x7f1e6d292376]
    /usr/lib/libmonosgen-2.0.so.1(+0x202ee3) [0x7f1e6d23fee3]
    /usr/lib/libmonosgen-2.0.so.1(+0x20e4ca) [0x7f1e6d24b4ca]
    /usr/lib/libmonosgen-2.0.so.1(+0x20245e) [0x7f1e6d23f45e]
    /usr/lib/libmonosgen-2.0.so.1(+0x1ca2f5) [0x7f1e6d2072f5]
    /usr/lib/libmonosgen-2.0.so.1(+0x47a15) [0x7f1e6d084a15]
    /home/azh/Downloads/pythonnet-master/clr.so(PyNet_Init+0x6e) [0x7f1e6d5e3ade]
    python(_PyImport_LoadDynamicModule+0x7c) [0x52267c]
    python(PyImport_ImportModuleLevel+0x785) [0x4af395]
    python() [0x4b10a8]
    python(PyObject_Call+0x43) [0x4b0de3]
    python(PyEval_CallObjectWithKeywords+0x30) [0x4ce140]
    python(PyEval_EvalFrameEx+0x31b1) [0x4c6d01]
    python(PyEval_EvalCodeEx+0x255) [0x4c22e5]
    python(PyEval_EvalCode+0x19) [0x4c2089]
    python() [0x4f1e6f]
    python(PyRun_FileExFlags+0x82) [0x4ec802]
    python(PyRun_SimpleFileExFlags+0x191) [0x4eaf81]
    python(Py_Main+0x68a) [0x49e36a]
    /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0) [0x7f1e6eb4c830]
    python(_start+0x29) [0x49dbf9]

Debug info from gdb:

[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
0x00007f1e6ef05f6a in __waitpid (pid=21550, stat_loc=0x7ffd0fcac48c, options=0) at ../sysdeps/unix/sysv/linux/waitpid.c:29
29  ../sysdeps/unix/sysv/linux/waitpid.c: No such file or directory.
  Id   Target Id         Frame 
* 1    Thread 0x7f1e6f313700 (LWP 21549) "python" 0x00007f1e6ef05f6a in __waitpid (pid=21550, stat_loc=0x7ffd0fcac48c, options=0) at ../sysdeps/unix/sysv/linux/waitpid.c:29

Thread 1 (Thread 0x7f1e6f313700 (LWP 21549)):
#0  0x00007f1e6ef05f6a in __waitpid (pid=21550, stat_loc=0x7ffd0fcac48c, options=0) at ../sysdeps/unix/sysv/linux/waitpid.c:29
#1  0x00007f1e6d10c23b in ?? () from /usr/lib/libmonosgen-2.0.so.1
#2  <signal handler called>
#3  0x00007f1e6eb61418 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
#4  0x00007f1e6eb6301a in __GI_abort () at abort.c:89
#5  0x00007f1e6d292019 in ?? () from /usr/lib/libmonosgen-2.0.so.1
#6  0x00007f1e6d292227 in ?? () from /usr/lib/libmonosgen-2.0.so.1
#7  0x00007f1e6d292376 in ?? () from /usr/lib/libmonosgen-2.0.so.1
#8  0x00007f1e6d23fee3 in ?? () from /usr/lib/libmonosgen-2.0.so.1
#9  0x00007f1e6d24b4ca in ?? () from /usr/lib/libmonosgen-2.0.so.1
#10 0x00007f1e6d23f45e in ?? () from /usr/lib/libmonosgen-2.0.so.1
#11 0x00007f1e6d2072f5 in ?? () from /usr/lib/libmonosgen-2.0.so.1
#12 0x00007f1e6d084a15 in ?? () from /usr/lib/libmonosgen-2.0.so.1
#13 0x00007f1e6d5e3ade in PyNet_Init (ext=1) at src/monoclr/pynetinit.c:30
#14 0x000000000052267c in _PyImport_LoadDynamicModule ()
#15 0x00000000004af395 in PyImport_ImportModuleLevel ()
#16 0x00000000004b10a8 in ?? ()
#17 0x00000000004b0de3 in PyObject_Call ()
#18 0x00000000004ce140 in PyEval_CallObjectWithKeywords ()
#19 0x00000000004c6d01 in PyEval_EvalFrameEx ()
#20 0x00000000004c22e5 in PyEval_EvalCodeEx ()
#21 0x00000000004c2089 in PyEval_EvalCode ()
#22 0x00000000004f1e6f in ?? ()
#23 0x00000000004ec802 in PyRun_FileExFlags ()
#24 0x00000000004eaf81 in PyRun_SimpleFileExFlags ()
#25 0x000000000049e36a in Py_Main ()
#26 0x00007f1e6eb4c830 in __libc_start_main (main=0x49dcd0 <main>, argc=2, argv=0x7ffd0fcadd58, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffd0fcadd48) at ../csu/libc-start.c:291
#27 0x000000000049dbf9 in _start ()

=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================

Aborted (core dumped)

I tried to reinstall completely mono, but no changes.

Any idea?

@zhukovgreen
Copy link
Author

Might be helpful. I have installed IronPython and it works with the same Mono

@den-run-ai
Copy link
Contributor

IronPython is not using C-API for Mono and CPython, so no need to compare it here. Please report your Linux version, Mono runtime, CPython version and how it was installed or built.

if you can record your full installation session using https://asciinema.org that would be great!

@den-run-ai
Copy link
Contributor

looks like you are hitting a bug in Mono, which was fixed in 4.3.2:

https://bugzilla.xamarin.com/show_bug.cgi?id=30594

@zhukovgreen
Copy link
Author

zhukovgreen commented Aug 9, 2016

Hello,

this is a recording of my session: https://asciinema.org/a/8aqpv14cq6ymnwkknltgcvet2

Linux is 4.4.0-31-generic, Mono - 4.4.2.11/f72fe45 Fri Jul 29 09:58:49 UTC 2016.
CPython - I don't know.

azh@azh:~$ python --version
Python 2.7.12
azh@azh:~$ python3 --version
Python 3.5.2

@den-run-ai
Copy link
Contributor

@zhukovgreen you forgot python setup.py build_ext --inplace. also your stack trace is visible only partially at the end of the recording.

@zhukovgreen
Copy link
Author

OK, thanks for that. Now it is corrected:
http://asciinema.org/a/6epq9tsvpwgjrc96gavjxkcle

@den-run-ai
Copy link
Contributor

@zhukovgreen I cannot believe that we are hitting so many bugs with Mono:

tjanczuk/edge#446

try Mono 4.2.4 like suggested in this linked issue.

@den-run-ai
Copy link
Contributor

mono 4.2.4.4 - this is what we are using in the travis build, please repeat all steps including dependencies. why did you switch to mono 4.4.2.0?

@zhukovgreen
Copy link
Author

I have tried mono 4.2.4.4 and the issue was persist with the same error. After that I switched to ironpython and reinstall the mono to the most recent version

@zhukovgreen
Copy link
Author

The comment #241 (comment)
shows my screen when I had mono 4.2.4.4

@zhukovgreen
Copy link
Author

I will share a asciinema recording a bit later

@den-run-ai
Copy link
Contributor

@zhukovgreen did pythonnet work for you finally? if not, then please send asciinema recording by repeating all steps in Travis CI.

Also report your Linux Distro (Ubuntu, Debian etc.)

@zhukovgreen
Copy link
Author

Hello @denfromufa,
I can't go further the command:

sudo DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confnew" install mono-devel mono-complete referenceassemblies-pcl ca-certificates-mono nunit-console

it says:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 mono-complete : Depends: mono-runtime (= 4.2.4.4-0wheezy1) but 4.4.2.11-0xamarin1 is to be installed
                 Depends: mono-runtime-sgen (= 4.2.4.4-0wheezy1) but 4.4.2.11-0xamarin1 is to be installed
                 Depends: mono-utils (= 4.2.4.4-0wheezy1) but it is not going to be installed
                 Depends: mono-devel (= 4.2.4.4-0wheezy1) but it is not going to be installed
                 Depends: mono-mcs (= 4.2.4.4-0wheezy1) but it is not going to be installed
                 Depends: mono-4.0-gac (= 4.2.4.4-0wheezy1) but 4.4.2.11-0xamarin1 is to be installed
                 Depends: libmono-cil-dev (= 4.2.4.4-0wheezy1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

I completely purged all mono files, removed repository and replaced it with the 4.2.4 snapshot repo.
apt autoremove or apt install -f not helping.

Anyway since it lasting too long, I suggest to close the issue, hoping that it is only unique not repetitive bug related to some specifics of my PC.

Thank you for your time

@den-run-ai
Copy link
Contributor

@zhukovgreen I think you need to report your problem with mono installation here:

https://bugzilla.xamarin.com/enter_bug.cgi?classification=__all

This has nothing to do with pythonnet.

@den-run-ai
Copy link
Contributor

Also you may need to update your list of available packages like this:

sudo apt-get update

@den-run-ai
Copy link
Contributor

@zhukovgreen FYI in version 2.2.0-dev1 we are bundling geninterop.py now.

pip install pythonnet --pre

@laskeym
Copy link

laskeym commented Jul 5, 2017

Hello. I'm trying to install pythonnet on Ubuntu 12.04 running Python 2.7.3. I've followed the build from https://travis-ci.org/pythonnet/pythonnet/jobs/148513880 and ran sudo python setup.py build_ext --inplace and the following was the output:

sudo python setup.py build_ext --inplace
running build_ext
Checking for updates from https://www.nuget.org/api/v2/.
Currently running NuGet.exe 4.1.0.
NuGet.exe is up to date.
MSBuild auto-detection: using msbuild version '14.0' from '/usr/lib/mono/xbuild/14.0/bin'.
All packages listed in packages.config are already installed.

xbuild tool is deprecated and will be removed in future updates, use msbuild instead <<<<

XBuild Engine Version 14.0
Mono, Version 5.0.1.1
Copyright (C) 2005-2013 Various Mono authors

xbuild tool is deprecated and will be removed in future updates, use msbuild instead <<<<

XBuild Engine Version 14.0
Mono, Version 5.0.1.1
Copyright (C) 2005-2013 Various Mono authors
Configuration: ReleaseMono Platform: x64
runtime.cs(284,17): warning CS0162: Unreachable code detected
Configuration: ReleaseMono Platform: x64
Configuration: ReleaseMono Platform: x64
dynamic.cs(121,28): warning CS0618: 'PythonEngine.RunString(string, IntPtr?, IntPtr?)' is obsolete: 'RunString is deprecated and will be removed. Use Exec/Eval/RunSimpleString instead.'
TestPythonEngineProperties.cs(171,17): warning CS0162: Unreachable code detected
Configuration: ReleaseMono Platform: x64
building 'clr' extension
creating build
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/src
creating build/temp.linux-x86_64-2.7/src/monoclr
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c src/monoclr/pynetinit.c -o build/temp.linux-x86_64-2.7/src/monoclr/pynetinit.o -D_REENTRANT -I/usr/lib/pkgconfig/../../include/mono-2.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include
src/monoclr/pynetinit.c: In function ‘main_thread_handler’:
src/monoclr/pynetinit.c:101:17: warning: variable ‘init_result’ set but not used [-Wunused-but-set-variable]
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c src/monoclr/clrmod.c -o build/temp.linux-x86_64-2.7/src/monoclr/clrmod.o -D_REENTRANT -I/usr/lib/pkgconfig/../../include/mono-2.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include
src/monoclr/clrmod.c:31:18: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro build/temp.linux-x86_64-2.7/src/monoclr/pynetinit.o build/temp.linux-x86_64-2.7/src/monoclr/clrmod.o -o /home/dclark/python/pythonnet/pythonnet/clr.so -L/usr/lib/pkgconfig/../../lib -lmono-2.0 -lm -lrt -ldl -lpthread -lglib-2.0`

Not really sure what's going on except that there is 'unreachable code'.

@den-run-ai
Copy link
Contributor

den-run-ai commented Jul 5, 2017

@laskeym I don't see any errors, did the build fail? Also see this section in wiki:

https://github.com/pythonnet/pythonnet/wiki/Troubleshooting-on-Windows,-Linux,-and-OSX#2-build-and-install-from-command-line

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