Upgraded Mono from 4.8 to 5.0.0.100 today, can't install pythonnet anymore. Errors thrown during installation. Installation works fine if I revert Mono back to 4.8
What commands did you run to trigger this issue?
pip install --upgrade pythonnet==2.3.0
If there was a crash, please include the traceback here.
XBuild Engine Version 14.0
Mono, Version 5.0.0.0
Copyright (C) 2005-2013 Various Mono authors
Configuration: ReleaseMono Platform: x64
/tmp/pip-build-8dGdQm/pythonnet/src/runtime/Python.Runtime.csproj: error : Error executing task Copy: Error converting Property named 'SourceFiles' with value '$(TargetAssemblyPdb)' to type Microsoft.Build.Framework.ITaskItem[]: Can't concatenate Item list with other strings where an item list is expected ('@(_OutDirItem->'%(FullPath)')', 'Python.Runtime.pdb'). Use semi colon to separate items.
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-8dGdQm/pythonnet/setup.py", line 405, in <module>
zip_safe=False,
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 "/home/phuihock/Work/mono5/env/local/lib/python2.7/site-packages/setuptools/command/install.py", line 61, in run
return orig.install.run(self)
File "/usr/lib/python2.7/distutils/command/install.py", line 601, in run
self.run_command('build')
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.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 "/tmp/pip-build-8dGdQm/pythonnet/setup.py", line 222, in build_extension
subprocess.check_call(" ".join(cmd + ["/t:Build"]), shell=use_shell)
File "/usr/lib/python2.7/subprocess.py", line 541, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'xbuild pythonnet.sln /p:Configuration=ReleaseMono /p:Platform=x64 /p:DefineConstants="PYTHON27,PYTHON2,UCS4,MONO_LINUX,PYTHON_WITHOUT_ENABLE_SHARED" /p:PythonBuildDir="/tmp/pip-build-8dGdQm/pythonnet/build/lib.linux-x86_64-2.7" /p:PythonInteropFile="interop27.cs" /verbosity:minimal /t:Build' returned non-zero exit status 1
----------------------------------------
Command "/home/phuihock/Work/mono5/env/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-8dGdQm/pythonnet/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-PVMfSd-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/phuihock/Work/mono5/env/include/site/python2.7/pythonnet" failed with error code 1 in /tmp/pip-build-8dGdQm/pythonnet/
If there is any other log/command output I should include, please advice.
Hi All, love PythonNET, great software, thanks so much! For anyone still struggling with this, the fix, as mentioned in several issues is to use the latest master to build your own wheel:
The cask is basically the latest version of the mono package from Xamarin. Since it's a Cask, it installs as a System Framework, instead of building from scratch into /usr/local. Versions of nuget, xbuild, msbuild, etc. are all located in the System Framework instead of /usr/local/bin, so you have to unlink the older Homebrew mono if you want to use the newer one and vice versa. If you ask Homebrew Cask for info, you get this caveat:
$ brew cask info mono-mdk
Installing mono-mdk removes mono and mono dependent formula binaries in
/usr/local/bin and adds mono-mdk to /private/etc/paths.d/
You may want to:
brew unlink {formula} && brew link {formula}
and/or remove /private/etc/paths.d/mono-commands
I personally prefer the newer one. Perhaps the two options can both be mentioned in the wiki, and then the user can choose.
Activity
den-run-ai commented on May 23, 2017
Thanks for trying out pythonnet, this is already tracked here:
#464
#471
mikofski commented on Nov 20, 2017
Hi All, love PythonNET, great software, thanks so much! For anyone still struggling with this, the fix, as mentioned in several issues is to use the latest master to build your own wheel:
system
NB you will need pkg-config, which you can get from homebrew
den-run-ai commented on Nov 20, 2017
@mikofski what is brew cask install mono-mdk doing? Do you think we should update the OSX notes here:
https://github.com/pythonnet/pythonnet/wiki/Troubleshooting-on-Windows,-Linux,-and-OSX#osx-notes
mikofski commented on Nov 20, 2017
@denfromufa currently, homebrew has two versions of mono, which are incompatible:
The cask is basically the latest version of the mono package from Xamarin. Since it's a Cask, it installs as a System Framework, instead of building from scratch into /usr/local. Versions of nuget, xbuild, msbuild, etc. are all located in the System Framework instead of /usr/local/bin, so you have to unlink the older Homebrew mono if you want to use the newer one and vice versa. If you ask Homebrew Cask for info, you get this caveat:
$ brew cask info mono-mdk Installing mono-mdk removes mono and mono dependent formula binaries in /usr/local/bin and adds mono-mdk to /private/etc/paths.d/ You may want to: brew unlink {formula} && brew link {formula} and/or remove /private/etc/paths.d/mono-commandsI personally prefer the newer one. Perhaps the two options can both be mentioned in the wiki, and then the user can choose.
AaronScruggs commented on Jan 19, 2018
@mikofski Thank you so much for those instructions! I have tried countless other solutions and yours was the only one that worked.
mikofski commented on Jan 23, 2018
FYI: after my latest brew update both the cask and the bottle are the same version, v5.4.1.6
saleph commented on May 15, 2018
I had a big issues with installation. In my case the solution was:
for Mono 5.10. Remember to rm -r ~/.cache/pip after previous attempts.