Repository navigation
Closed
Description
Environment
- Pythonnet version: 2.4.0
- Python version: 2.7.5
- Operating System: Red Hat Enterprise Linux Server release 7.3 (Maipo)
- DotNet version: 2.0.0
Details
-
Error restoring packages while trying to build from the command line in Linux
-
I used the following commands to create the issue:
pip install wheel
pip install pytest
git clone https://github.com/pythonnet/pythonnet.git
cd pythonnet
python setup.py bdist_wheel --xplat- Details of the error below:
running bdist_wheel
running build
running build_ext
Microsoft (R) Build Engine version 15.3.409.57025 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
Restore completed in 24.15 ms for /users/isys/icronyn/git/pythonnet/src/testing/Python.Test.15.csproj.
Restore completed in 24.16 ms for /users/isys/icronyn/git/pythonnet/src/console/Console.15.csproj.
Restore completed in 26.29 ms for /users/isys/icronyn/git/pythonnet/src/runtime/Python.Runtime.15.csproj.
Restore completed in 86.12 ms for /users/isys/icronyn/git/pythonnet/src/embed_tests/Python.EmbeddingTest.15.csproj.
Microsoft (R) Build Engine version 15.3.409.57025 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
Microsoft (R) Build Engine version 15.3.409.57025 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
pyobject.cs(50,13): warning CS0162: Unreachable code detected [/users/isys/icronyn/git/pythonnet/src/runtime/Python.Runtime.15.csproj]
pythonexception.cs(64,13): warning CS0162: Unreachable code detected [/users/isys/icronyn/git/pythonnet/src/runtime/Python.Runtime.15.csproj]
delegatemanager.cs(204,13): warning CS0162: Unreachable code detected [/users/isys/icronyn/git/pythonnet/src/runtime/Python.Runtime.15.csproj]
pyscope.cs(534,13): warning CS0162: Unreachable code detected [/users/isys/icronyn/git/pythonnet/src/runtime/Python.Runtime.15.csproj]
Python.Runtime.15 -> /users/isys/icronyn/git/pythonnet/src/runtime/bin/Python.Runtime.dll
pyobject.cs(50,13): warning CS0162: Unreachable code detected [/users/isys/icronyn/git/pythonnet/src/runtime/Python.Runtime.15.csproj]
delegatemanager.cs(204,13): warning CS0162: Unreachable code detected [/users/isys/icronyn/git/pythonnet/src/runtime/Python.Runtime.15.csproj]
pythonexception.cs(64,13): warning CS0162: Unreachable code detected [/users/isys/icronyn/git/pythonnet/src/runtime/Python.Runtime.15.csproj]
pyscope.cs(534,13): warning CS0162: Unreachable code detected [/users/isys/icronyn/git/pythonnet/src/runtime/Python.Runtime.15.csproj]
Python.Runtime.15 -> /users/isys/icronyn/git/pythonnet/src/runtime/bin/netstandard2.0/Python.Runtime.dll
Console.15 -> /users/isys/icronyn/git/pythonnet/src/console/bin/nPython.exe
Python.Test.15 -> /users/isys/icronyn/git/pythonnet/src/testing/bin/Python.Test.dll
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.' [/users/isys/icronyn/git/pythonnet/src/embed_tests/Python.EmbeddingTest.15.csproj]
Python.EmbeddingTest.15 -> /users/isys/icronyn/git/pythonnet/src/embed_tests/bin/Python.EmbeddingTest.dll
Python.Test.15 -> /users/isys/icronyn/git/pythonnet/src/testing/bin/netstandard2.0/Python.Test.dll
Console.15 -> /users/isys/icronyn/git/pythonnet/src/console/bin/netcoreapp2.0/nPython.dll
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.' [/users/isys/icronyn/git/pythonnet/src/embed_tests/Python.EmbeddingTest.15.csproj]
Python.EmbeddingTest.15 -> /users/isys/icronyn/git/pythonnet/src/embed_tests/bin/netcoreapp2.0/Python.EmbeddingTest.dll
Microsoft (R) Build Engine version 15.3.409.57025 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
Python.Runtime.15 -> /users/isys/icronyn/git/pythonnet/src/runtime/bin/netstandard2.0/Python.Runtime.dll
Console.15 -> /users/isys/icronyn/git/pythonnet/src/console/bin/netcoreapp2.0/nPython.dll
Console.15 -> /users/isys/icronyn/git/pythonnet/build/lib.linux-x86_64-2.7/netcoreapp2.0/
Python.EmbeddingTest.15 -> /users/isys/icronyn/git/pythonnet/src/embed_tests/bin/netcoreapp2.0/Python.EmbeddingTest.dll
Python.EmbeddingTest.15 -> /users/isys/icronyn/git/pythonnet/src/embed_tests/bin/netcoreapp2.0_publish/
Package mono-2 was not found in the pkg-config search path.
Perhaps you should add the directory containing `mono-2.pc'
to the PKG_CONFIG_PATH environment variable
No package 'mono-2' found
Traceback (most recent call last):
File "setup.py", line 522, in <module>
zip_safe=False,
File "/opt/man/releases/python-medusa/27-1/lib/python2.7/distutils/core.py", line 151, in setup
dist.run_commands()
File "/opt/man/releases/python-medusa/27-1/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/opt/man/releases/python-medusa/27-1/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "setup.py", line 470, in run
return bdist_wheel.bdist_wheel.run(self)
File "/users/isys/icronyn/pyenvs/pythonnet/lib/python2.7/site-packages/wheel-0.30.0-py2.7.egg/wheel/bdist_wheel.py", line 204, in run
self.run_command('build')
File "/opt/man/releases/python-medusa/27-1/lib/python2.7/distutils/cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "/opt/man/releases/python-medusa/27-1/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/opt/man/releases/python-medusa/27-1/lib/python2.7/distutils/command/build.py", line 127, in run
self.run_command(cmd_name)
File "/opt/man/releases/python-medusa/27-1/lib/python2.7/distutils/cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "/opt/man/releases/python-medusa/27-1/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/opt/man/releases/python-medusa/27-1/lib/python2.7/distutils/command/build_ext.py", line 339, in run
self.build_extensions()
File "/opt/man/releases/python-medusa/27-1/lib/python2.7/distutils/command/build_ext.py", line 448, in build_extensions
self.build_extension(ext)
File "setup.py", line 270, in build_extension
self._build_monoclr()
File "setup.py", line 284, in _build_monoclr
mono_libs = _check_output("pkg-config --libs mono-2", shell=True)
File "setup.py", line 98, in _check_output
output = subprocess.check_output(*args, **kwargs)
File "/opt/man/releases/python-medusa/27-1/lib/python2.7/subprocess.py", line 573, in check_output
raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command 'pkg-config --libs mono-2' returned non-zero exit status 1Metadata
Metadata
Assignees
Labels
No labels
Activity
Cronan commentedon Nov 14, 2017
Is this the same as #555 ?
Cronan commentedon Nov 14, 2017
Also tried the following as referred to by @dmitriyse in #531 :
Same error.
dmitriyse commentedon Nov 14, 2017
I need to research what the reason of mono-2 related problems. This error occurs not only in your environment.
Cronan commentedon Nov 14, 2017
Let me know if you need me to try help with debugging, provide extra log, etc
den-run-ai commentedon Nov 14, 2017
@Cronan what mono version do you have installed? and how did you install it? did you try without
--xplat?Cronan commentedon Nov 14, 2017
I don't have mono installed - is it still a requirement even with --xplat?
dmitriyse commentedon Nov 14, 2017
No, it's should not be required with --xplat option. Probably we have bug.
Cronan commentedon Nov 14, 2017
Setup.py contains:
This is called here:
It's basically a call to subprocess.check_output("pkg-config --libs mono-2", shell=True) that returning 1, which I'd expect, because I don't have mono installed.
Unless I'm oversimplifying ...
dmitriyse commentedon Nov 14, 2017
Yes, some problem exists. I need to re-inspect all setup.py to fix this problem. Stay tuned, I think I will fix it until tomorrow.
Cronan commentedon Nov 14, 2017
Works:
Fails:
Both run inside my python interpreter.
dmitriyse commentedon Nov 15, 2017
monoclr module can be build only when mono is installed.
When you have only dotnet core, it's should be allowed to work without monoclr module.
Currently the only way to work with pythonnet vs dotnet core is to run:
Cronan commentedon Dec 7, 2017
I finally managed to build by editing setup.py, modifying the following line in BuildExtPythonnet.build_extension:
if DEVTOOLS == "Mono": #or DEVTOOLS == "dotnet":self._build_monoclr()This seems to complete the build, and I can then run using nPython:
dotnet ./build/lib.linux-x86_64-2.7/netcoreapp2.0/nPython.dll>>>import clr>>>from System import String, Char, Int32>>>s = String.Overloads[Char, Int32]('A', 10)>>> s.get_Length()10
But as soon as I try other things, it crashes hard:
>>> from System.Collections.Generic import DictionaryCronan commentedon Dec 7, 2017
I'm also unable to run the tests:
Cronan commentedon Dec 8, 2017
I managed to get the tests working in nPython by appending pytest and py to the sys.path.
However, the stack trace obtained looks very similar to the recursion issue I see above:
Cronan commentedon Dec 8, 2017
Oh dear
https://github.com/dotnet/coreclr/issues/12668
Looks like it was fixed but missed the cutoff for the 2.0.0 release
Now if I could only work out how to change the thread culture from inside pythonengine.cs ...
Any hints where I could do this as a workaround?
I tried doing it after
PythonEngine.Initialize();, but it doesn't seem to make a difference ...den-run-ai commentedon Dec 8, 2017
@Cronan can't you just switch your local
CultureInfosettings on this machine as a temporary workaround?den-run-ai commentedon Dec 8, 2017
@Cronan alternatively just install .NET Core 2.0.3 released few weeks ago: https://github.com/dotnet/core/blob/master/release-notes/download-archives/2.0.3.md
Cronan commentedon Dec 8, 2017
@denfromufa I don't have a dedicated headnode, and 2.0.3 won't be available via the standard Enterprise upgrade cycle for a few weeks, but I've got a plan to test this on Monday.
Cronan commentedon Dec 8, 2017
@denfromufa OK, figured out how to change my locale, and the tests are now running.
Any ideas what this could be? Is it fixed by something in another branch?
Cronan commentedon Dec 12, 2017
Fixed with #572