Я получаю «Необработанное исключение: System.TypeLoadException: не удалось загрузить тип« System.AppContext »из сборки« mscorlib »при установке pythonnet в ubuntu.
Ниже моя конфигурация:
Ubuntu 64 бит 16V04
Моно 4.2.1.102
Python 2.7.12
Когда я запускаю pip install pythonnet для установки pythonnet, мы получаем ошибку ниже:
Collecting pythonnet
Using cached https://files.pythonhosted.org/packages/89/3b/a22cd45b591d6cf490ee8b24d52b9db1f30b4b478b64a9b231c53474731e/pythonnet-2.3.0.tar.gz
Building wheels for collected packages: pythonnet
Building wheel for pythonnet (setup.py) ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-nbh58I/pythonnet/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-1ZQZYo --python-tag cp27:
running bdist_wheel
running build
running build_ext
Checking for updates from https://www.nuget.org/api/v2/.
Currently running NuGet.exe 3.5.0.
Updating NuGet.exe to 4.9.4.
Update successful.
Unhandled Exception:
**System.TypeLoadException: Could not load type 'System.AppContext'** from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeLoadException: Could not load type 'System.AppContext' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e08`enter code here`9'.
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-nbh58I/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 "/usr/lib/python2.7/dist-packages/wheel/bdist_wheel.py", line 179, 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-install-nbh58I/pythonnet/setup.py", line 139, in build_extension
self._install_packages()
File "/tmp/pip-install-nbh58I/pythonnet/setup.py", line 273, in _install_packages
subprocess.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
Пожалуйста, помогите рассмотреть.