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
{{ message }}
Repository navigation
latest master cannot be installed with pip+git #555
File "setup.py", line 311, in _install_packages
subprocess.check_call(cmd, shell=use_shell)
File "/Users/vh/anaconda/lib/python3.5/subprocess.py", line 581, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'dotnet msbuild /t:Restore pythonnet.15.sln /p:Configuration=ReleaseMono /p:Platform=x64' returned non-zero exit status 127
Pitching in here, I've been trying to get pythonnet installed for a few days on macOS 10.13.1 with no luck. I've tried all of the work-arounds and solutions which I've found between here and #465.
Obvious differences between setups like @vkhombal's and mine is that I'm using MacPorts instead of Homebrew, and that since the port install mono installs an older version, I build from the .pkg at mono-project.com (so I'm running v5.4.0).
From above, python setup.py bdist_wheel fails with subprocess.CalledProcessError: Command 'pkg-config --libs mono-2' returned non-zero exit status 1
Any advice is appreciated. I've starred the repo and will update if I figure anything out.
@nsbruce more detailed error would be really helpful, but my understanding is that macports is a lot less used than homebrew and so we cannot support yet another scenario.
Also please provide versions for all dependencies.
> port info glib2
glib2 @2.54.2 (devel)
Variants: quartz, universal, [+]x11
Description: Glib is a library which includes support routines for C,
such as lists, trees, hashes, memory allocation, and many
other things.
Homepage: https://wiki.gnome.org/Projects/GLib
Extract Dependencies: xz
Build Dependencies: libxml2
Library Dependencies: gettext, libffi, libiconv, pcre, zlib
Conflicts with: glib2-devel
Platforms: darwin
License: LGPL-2+
Maintainers: Email: ryandesign@macports.org, GitHub: ryandesign
Policy: openmaintainer
> python --version
Python 2.7.14
When I run sudo python setup.py bdist_wheel (without sudo it doesn't run):
sudo python setup.py bdist_wheel
Password:
running bdist_wheel
running build
running build_ext
Checking for updates from https://www.nuget.org/api/v2/.
Currently running NuGet.exe 4.1.0.
Updating NuGet.exe to 4.3.0.
Update successful.
MSBuild auto-detection: using msbuild version '15.0' from '/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/msbuild/15.0/bin/'.
Restoring NuGet package NUnit.ConsoleRunner.3.7.0.
Restoring NuGet package UnmanagedExports.1.2.7.
Restoring NuGet package NUnit.3.7.1.
Adding package 'NUnit.ConsoleRunner.3.7.0' to folder '/Users/nsbruce-school/Downloads/pythonnet-master/packages'
Adding package 'UnmanagedExports.1.2.7' to folder '/Users/nsbruce-school/Downloads/pythonnet-master/packages'
Adding package 'NUnit.3.7.1' to folder '/Users/nsbruce-school/Downloads/pythonnet-master/packages'
Added package 'UnmanagedExports.1.2.7' to folder '/Users/nsbruce-school/Downloads/pythonnet-master/packages'
Added package 'NUnit.ConsoleRunner.3.7.0' to folder '/Users/nsbruce-school/Downloads/pythonnet-master/packages'
Added package 'NUnit.3.7.1' to folder '/Users/nsbruce-school/Downloads/pythonnet-master/packages'
NuGet Config files used:
/Users/nsbruce-school/Downloads/pythonnet-master/nuget.config
/Users/nsbruce-school/.config/NuGet/NuGet.Config
Feeds used:
/Users/nsbruce-school/.nuget/packages/
https://dotnet.myget.org/F/dotnet-core/api/v3/index.json
https://api.nuget.org/v3/index.json
Installed:
3 package(s) to packages.config projects
>>>> xbuild tool is deprecated and will be removed in future updates, use msbuild instead <<<<
XBuild Engine Version 14.0
Mono, Version 5.4.0.0
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.4.0.0
Copyright (C) 2005-2013 Various Mono authors
Configuration: ReleaseMono Platform: x64
delegatemanager.cs(204,13): warning CS0162: Unreachable code detected
runtime.cs(327,17): warning CS0162: Unreachable code detected
pythonexception.cs(64,13): warning CS0162: Unreachable code detected
pyobject.cs(50,13): warning CS0162: Unreachable code detected
pyscope.cs(534,13): 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.'
Configuration: ReleaseMono Platform: x64
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/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 151, in setup
dist.run_commands()
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/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 "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/wheel/bdist_wheel.py", line 204, in run
self.run_command('build')
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/build.py", line 127, in run
self.run_command(cmd_name)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/build_ext.py", line 340, in run
self.build_extensions()
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/build_ext.py", line 449, 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/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 219, in check_output
raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command 'pkg-config --libs mono-2' returned non-zero exit status 1
I've found mono-2.pc at /Library/Frameworks/Mono.framework/Versions/5.4.0/lib/pkgconfig/mono-2.pc
I tried to link it into /local/lib with:
> cd /usr/local/lib/pkgconfig/
>sudo ln -s /Library/Frameworks/Mono.framework/Versions/5.4.0/lib/pkgconfig/mono-2.pc
But I see the same error,
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
I thought that export PKG_CONFIG_PATH=/Library/Frameworks/Mono.framework/Versions/5.4.0/lib/pkgconfig would definitely do it, but no.
Something funky is going on. The above doesn't make sense to me. I'll update this comment as I go.
I'm trying to force mono-2 into the path but there must be an issue with the order of my PATH variable? Similar issue
@nsbruce like I mentioned, macports is not supported scenario for pythonnet and mono. please move your comments from this issue to a new issue with title about macports and osx. someone may have done this before:
I'm using Python 3.8.1 with pip 20.0.2 on Windows 10, and when I do a "pip install pythonnet", I still get --single-version-externally-managed not recognized.
Activity
vkhombal commentedon Oct 18, 2017
I have the same problem
den-run-ai commentedon Oct 18, 2017
vkhombal commentedon Oct 19, 2017
hi, thanks.
hi, i tried
python setup.py bdist_wheel --xplatthis gives
PS: I'm trying this on OSX
den-run-ai commentedon Oct 19, 2017
Remove
--xplatto use Mono instead of .NET Core.den-run-ai commentedon Oct 24, 2017
Related, thanks to @dmitriyse and @hjaekel for the deprecated
--eggtemp workaround:#562 (comment)
vkhombal commentedon Oct 24, 2017
On OSX for the following worked.
Thank you @denfromufa
den-run-ai commentedon Oct 24, 2017
@vkhombal don't forget to star the repo :)
I added the link to your instructions for mac here:
#465
nsbruce commentedon Nov 6, 2017
Pitching in here, I've been trying to get pythonnet installed for a few days on macOS 10.13.1 with no luck. I've tried all of the work-arounds and solutions which I've found between here and #465.
Obvious differences between setups like @vkhombal's and mine is that I'm using MacPorts instead of Homebrew, and that since the
port install monoinstalls an older version, I build from the .pkg at mono-project.com (so I'm running v5.4.0).From above,
python setup.py bdist_wheelfails withsubprocess.CalledProcessError: Command 'pkg-config --libs mono-2' returned non-zero exit status 1Any advice is appreciated. I've starred the repo and will update if I figure anything out.
den-run-ai commentedon Nov 7, 2017
@nsbruce more detailed error would be really helpful, but my understanding is that macports is a lot less used than homebrew and so we cannot support yet another scenario.
Also please provide versions for all dependencies.
nsbruce commentedon Nov 8, 2017
Dependency versions:
When I run
sudo python setup.py bdist_wheel(without sudo it doesn't run):nsbruce commentedon Nov 8, 2017
I've found mono-2.pc at
/Library/Frameworks/Mono.framework/Versions/5.4.0/lib/pkgconfig/mono-2.pcI tried to link it into
/local/libwith:But I see the same error,
I thought that
export PKG_CONFIG_PATH=/Library/Frameworks/Mono.framework/Versions/5.4.0/lib/pkgconfigwould definitely do it, but no.Something funky is going on. The above doesn't make sense to me. I'll update this comment as I go.
I'm trying to force mono-2 into the path but there must be an issue with the order of my PATH variable? Similar issue
Currently, for me:
den-run-ai commentedon Nov 8, 2017
@nsbruce please downgrade to mono 5.2, there is a bug with mono 5.4, it fails few tests.
nsbruce commentedon Nov 8, 2017
@denfromufa same error at 5.2.0.224
den-run-ai commentedon Nov 10, 2017
@nsbruce like I mentioned, macports is not supported scenario for pythonnet and mono. please move your comments from this issue to a new issue with title about macports and osx. someone may have done this before:
https://mail.python.org/pipermail/pythondotnet/2013-June/001383.html
den-run-ai commentedon Jan 28, 2018
Side effect of this
--egginstallation option is thatpip uninstall pythonnetdoes not remove the files correctly:Python.Runtime.dll and clr.pyd are left in place.
den-run-ai commentedon May 29, 2018
somehow this is now fixed with latest pip:
eric-appion commentedon Feb 21, 2020
I'm using Python 3.8.1 with pip 20.0.2 on Windows 10, and when I do a "pip install pythonnet", I still get --single-version-externally-managed not recognized.
cnaccio commentedon Oct 1, 2020
Running Python 3.8.5 with Mono 6.10.0 on OSX Catalina, as able to get pip install pythonnet by setting a PKG_CONFIG_PATH as below. Hope this helps!
export PKG_CONFIG_PATH=/Library/Frameworks/Mono.framework/Versions/Current/lib/pkgconfigsorenwacker commentedon Jan 19, 2021
This path does not seem to exist on Linux systems. Is there an alternative?