无法在 pip install pythonnet WSL 2 VS Code 上构建轮子和单一版本外部管理的无法识别错误
Can't build wheel and single-version-externally-managed not recognized error on pip install pythonnet WSL 2 VS Code
我在 VS Code 中使用 WSL2。在 VS Code 上使用 Zsh。
我正在尝试安装 pythonnet,但遇到两个错误:
错误:为 pythonnet 构建轮子失败
错误:选项 --single-version-externally-managed 无法识别
这是使用pip install pythonnet==2.5.2
我的版本是:
Python 3.8.10
车轮 0.37.0
单声道:6.8.0.105
pycparser 2.20
虽然我找不到解决方案,但我已经在网上搜索了高低 - 一切似乎都指向更新轮子和安装单声道 - 从上面的版本号可以看出,我已经安装了它们。
我在虚拟环境中做所有事情。
有没有人对此有任何经验或知道如何克服这些错误?
完整日志:
~/j/s/stx1alpha-signals/d/backend on master !6 ?1 ❯ pip install
pythonnet==2.5.2
stx1alpha at 10:52:05 AM Collecting pythonnet==2.5.2 Using cached
pythonnet-2.5.2.tar.gz (1.9 MB) Preparing metadata (setup.py) ...
done Requirement already satisfied: pycparser in
/home/jessica-ryan/jessica-ryan/stx1alpha/.venv/lib/python3.8/site-packages
(from pythonnet==2.5.2) (2.20) Building wheels for collected packages:
pythonnet Building wheel for pythonnet (setup.py) ... error ERROR:
Command errored out with exit status 1: command:
/home/jessica-ryan/jessica-ryan/stx1alpha/.venv/bin/python -u -c
'import io, os, sys, setuptools, tokenize; sys.argv[0] =
'"'"'/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/setup.py'"'"';
file='"'"'/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/setup.py'"'"';f
= getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import
setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"',
'"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))'
bdist_wheel -d /tmp/pip-wheel-789kx5l4
cwd: /tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/
Complete output (153 lines): 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 5.11.0. Update successful. MSBuild
auto-detection: using msbuild version '14.0' from
'/usr/lib/mono/xbuild/14.0/bin'.
xbuild tool is deprecated and will be removed in future updates, use msbuild instead <<<<
MSBUILD: error MSBUILD0004: Too many project files specified
WARNING: Error reading msbuild project information, ensure that your input solution or project file is valid. NETCore and UAP projects
will be skipped, only packages.config files will be restored.
Restoring NuGet package System.ValueTuple.4.5.0. Restoring NuGet
package NUnit.ConsoleRunner.3.11.1. Restoring NuGet package
NUnit.3.12.0. Restoring NuGet package UnmanagedExports.1.2.7.
Adding package 'NUnit.3.12.0' to folder
'/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/packages' Adding package 'System.ValueTuple.4.5.0' to folder
'/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/packages' Adding package 'UnmanagedExports.1.2.7' to folder
'/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/packages' Adding package 'NUnit.ConsoleRunner.3.11.1' to folder
'/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/packages' Added package 'UnmanagedExports.1.2.7' to folder
'/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/packages' Added package 'System.ValueTuple.4.5.0' to folder
'/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/packages' Added package 'NUnit.ConsoleRunner.3.11.1' to folder
'/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/packages' Added package 'NUnit.3.12.0' to folder
'/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/packages'
NuGet Config files used:
/home/jessica-ryan/.config/NuGet/NuGet.Config
Feeds used:
/home/jessica-ryan/.nuget/packages/
https://api.nuget.org/v3/index.json
Installed:
4 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 6.8.0.105 Copyright (C) 2005-2013 Various Mono authors
Build started 11/18/2021 10:53:28. __________________________________________________ Project "/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/pythonnet.sln"
(Clean target(s)):
Target ValidateSolutionConfiguration:
Building solution configuration "ReleaseMono|x64".
Target Clean:
Project "/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/src/runtime/Python.Runtime.csproj"
(Clean target(s)):
Target CoreClean:
Deleting file '/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/src/runtime/obj/x64/ReleaseMono/.NETFramework,Version=v4.0.AssemblyAttribute.cs'
Done building project "/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/src/runtime/Python.Runtime.csproj".
The project 'clrmodule' is disabled for solution configuration 'ReleaseMono|x64'.
Project "/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/src/testing/Python.Test.csproj"
(Clean target(s)):
Target CoreClean:
Deleting file '/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/src/testing/obj/x64/ReleaseMono/.NETFramework,Version=v4.0.AssemblyAttribute.cs'
Done building project "/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/src/testing/Python.Test.csproj".
Project "/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/src/embed_tests/Python.EmbeddingTest.csproj"
(Clean target(s)):
Target CoreClean:
Deleting file '/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/src/embed_tests/obj/x64/ReleaseMono/.NETFramework,Version=v4.0.AssemblyAttribute.cs'
Done building project "/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/src/embed_tests/Python.EmbeddingTest.csproj".
Project "/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/src/console/Console.csproj"
(Clean target(s)):
Target CoreClean:
Deleting file '/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/src/console/obj/x64/ReleaseMono/.NETFramework,Version=v4.0.AssemblyAttribute.cs'
Done building project "/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/src/console/Console.csproj".
Done building project
"/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/pythonnet.sln".
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:00:00.3407830
xbuild tool is deprecated and will be removed in future updates, use msbuild instead <<<<
XBuild Engine Version 14.0 Mono, Version 6.8.0.105 Copyright (C) 2005-2013 Various Mono authors
Build started 11/18/2021 10:53:29. __________________________________________________ Project "/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/pythonnet.sln"
(Build target(s)):
Target ValidateSolutionConfiguration:
Building solution configuration "ReleaseMono|x64".
Target Build:
Project "/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/src/runtime/Python.Runtime.csproj"
(default target(s)):
Target PrepareForBuild:
Configuration: ReleaseMono Platform: x64
Created directory "bin/"
Target GenerateSatelliteAssemblies:
No input files were specified for target GenerateSatelliteAssemblies, skipping.
Target CoreCompile:
Tool /usr/lib/mono/4.5/mcs.exe execution started with arguments: /noconfig /debug:pdbonly /optimize+
/out:obj/x64/ReleaseMono/Python.Runtime.dll
/resource:obj/x64/ReleaseMono/Python.Runtime.resources.clr.py,clr.py
Codecs/EncoderGroup.cs Codecs/DecoderGroup.cs
Codecs/RawProxyEncoder.cs Codecs/TupleCodecs.cs converterextensions.cs
finalizer.cs Properties/AssemblyInfo.cs ../SharedAssemblyInfo.cs
arrayobject.cs assemblymanager.cs BorrowedReference.cs classderived.cs
classbase.cs classmanager.cs classobject.cs clrobject.cs
codegenerator.cs constructorbinder.cs constructorbinding.cs
converter.cs CustomMarshaler.cs debughelper.cs delegatemanager.cs
delegateobject.cs eventbinding.cs eventobject.cs exceptions.cs
extensiontype.cs fieldobject.cs generictype.cs genericutil.cs
importhook.cs indexer.cs interfaceobject.cs interfaces.cs interop.cs
iterator.cs managedtype.cs metatype.cs methodbinder.cs
methodbinding.cs methodobject.cs methodwrapper.cs
modulefunctionobject.cs moduleobject.cs modulepropertyobject.cs
nativecall.cs NewReference.cs NonCopyableAttribute.cs overload.cs
propertyobject.cs pyansistring.cs pydict.cs PyExportAttribute.cs
pyfloat.cs pyint.cs pyiter.cs pylist.cs pylong.cs pynumber.cs
pyobject.cs pyscope.cs pysequence.cs pystring.cs pythonengine.cs
pythonexception.cs pytuple.cs ReferenceExtensions.cs runtime.cs
typemanager.cs typemethod.cs Util.cs platform/Types.cs
platform/LibraryLoader.cs polyfill/ReflectionPolifills.cs
slots/mp_length.cs interop38.cs
obj/x64/ReleaseMono/.NETFramework,Version=v4.0.AssemblyAttribute.cs
/target:library /unsafe+
/define:"PYTHON38;PYTHON3;UCS4;MONO_LINUX;PYTHON_WITHOUT_ENABLE_SHARED"
/nowarn:1591 /doc:bin/Python.Runtime.xml /langversion:7.3 /nostdlib
/reference:/usr/lib/mono/4.0-api/System.dll
/reference:/usr/lib/mono/4.0-api/System.Core.dll
/reference:/usr/lib/mono/4.0-api//mscorlib.dll CSC: error CS1617:
Invalid -langversion option 7.3'. It must be
ISO-1', `ISO-2',
Default, Latest or value in range 1 to 7.2
Task "Csc" execution -- FAILED
Done building target "CoreCompile" in project "/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/src/runtime/Python.Runtime.csproj".--
FAILED
Done building project "/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/src/runtime/Python.Runtime.csproj".--
FAILED
Task "MSBuild" execution -- FAILED
Done building target "Build" in project "/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/pythonnet.sln".-- FAILED Done building project
"/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/pythonnet.sln".-- FAILED
Build FAILED. Errors:
/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/pythonnet.sln
(Build) -> (Build target) ->
/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/src/runtime/Python.Runtime.csproj
(default targets) ->
/usr/lib/mono/xbuild/14.0/bin/Microsoft.CSharp.targets (CoreCompile
target) ->
CSC: error CS1617: Invalid -langversion option `7.3'. It must be `ISO-1', `ISO-2', Default, Latest or value in range 1 to 7.2
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.3647620 Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/setup.py",
第 630 行,在
设置(
文件“/home/jessica-ryan/jessica-ryan/stx1alpha/.venv/lib/python3.8/site-packages/setuptools/init.py”,
第 153 行,在设置中
return distutils.core.setup(**属性)
文件“/usr/lib/python3.8/distutils/core.py”,第 148 行,在设置中
dist.run_commands()
文件“/usr/lib/python3.8/distutils/dist.py”,第 966 行,在 run_commands 中
self.run_command(指令)
文件“/usr/lib/python3.8/distutils/dist.py”,第 985 行,在 run_command 中
cmd_obj.run()
文件“/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/setup.py”,
第 612 行,在 运行
return bdist_wheel.bdist_wheel.run(自己)
文件“/home/jessica-ryan/jessica-ryan/stx1alpha/.venv/lib/python3.8/site-packages/wheel/bdist_wheel.py”,
第 299 行,在 运行
self.run_command('build')
文件“/usr/lib/python3.8/distutils/cmd.py”,第 313 行,在 run_command 中
self.distribution.run_command(命令)
文件“/usr/lib/python3.8/distutils/dist.py”,第 985 行,在 run_command 中
cmd_obj.run()
文件“/usr/lib/python3.8/distutils/command/build.py”,第 135 行,在 运行 中
self.run_command(cmd_name)
文件“/usr/lib/python3.8/distutils/cmd.py”,第 313 行,在 run_command 中
self.distribution.run_command(命令)
文件“/usr/lib/python3.8/distutils/dist.py”,第 985 行,在 run_command 中
cmd_obj.run()
文件“/usr/lib/python3.8/distutils/command/build_ext.py”,第 340 行,在 运行 中
self.build_extensions()
文件“/usr/lib/python3.8/distutils/command/build_ext.py”,第 449 行,在 build_extensions 中
self._build_extensions_serial()
文件“/usr/lib/python3.8/distutils/command/build_ext.py”,第 474 行,在 _build_extensions_serial
self.build_extension(分机)
文件“/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/setup.py”,
第 353 行,在 build_extension
subprocess.check_call(" ".join(cmd + ["/t:Build"]), shell=use_shell)
文件“/usr/lib/python3.8/subprocess.py”,第 364 行,在 check_call 中
引发 CalledProcessError(retcode,cmd)subprocess.CalledProcessError:命令'xbuild pythonnet.sln
/p:Configuration=ReleaseMono /p:Platform=x64
/p:DefineConstants="PYTHON38%3BPYTHON3%3BUCS4%3BMONO_LINUX%3BPYTHON_WITHOUT_ENABLE_SHARED"
/p:PythonBuildDir="/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/build/lib.linux-x86_64-3.8"
/p:PythonInteropFile="interop38.cs" /p:PackageId=pythonnet_py38_x64
/verbosity:normal /t:Build' returned 非零退出状态 1.
-------------------------------------- 错误:pythonnet 构建轮失败 运行 setup.py 清理 pythonnet 失败
build pythonnet 安装收集的包:pythonnet
运行 setup.py 安装 pythonnet ... 错误
错误:命令出错,退出状态为 1:
命令:/home/jessica-ryan/jessica-ryan/stx1alpha/.venv/bin/python -u -c
'导入 io, os, sys, setuptools, tokenize; sys.argv[0] =
'"'"'/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/setup.py'"'"';
文件='"'"'/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/setup.py'"'"';f
= getattr(tokenize, '"'"'open'"'"', 打开)(file) 如果os.path.exists(file) else io.StringIO('"'"'from setuptools import
设置; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"',
'"'"'\n'"'"');f.close();exec(编译(代码, 文件, '"'"'exec'" '"'))'
安装 --record /tmp/pip-record-2fxmdkst/install-record.txt
--single-version-externally-managed --compile --install-headers /home/jessica-ryan/jessica-ryan/stx1alpha/.venv/include/site/python3.8/pythonnet
cwd: /tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/
完整输出(6 行):
用法:setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
或者:setup.py --help [cmd1 cmd2 ...]
或者:setup.py --help-commands
或者:setup.py cmd --help
error: option --single-version-externally-managed not recognized
---------------------------------------- ERROR: Command errored out with exit status 1:
/home/jessica-ryan/jessica-ryan/stx1alpha/.venv/bin/python -u -c
'导入 io, os, sys, setuptools, tokenize; sys.argv[0] =
'"'"'/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/setup.py'"'"';
文件='"'"'/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/setup.py'"'"';f
= getattr(tokenize, '"'"'open'"'"', 打开)(file) 如果os.path.exists(file) else io.StringIO('"'"'from setuptools import
设置; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"',
'"'"'\n'"'"');f.close();exec(编译(代码, 文件, '"'"'exec'" '"'))'
安装 --record /tmp/pip-record-2fxmdkst/install-record.txt
--single-version-externally-managed --compile --install-headers /home/jessica-ryan/jessica-ryan/stx1alpha/.venv/include/site/python3.8/pythonnet
检查日志以获取完整的命令输出。
您需要更新版本的 Mono。您拥有的不支持 Pythonnet 构建所需的 C# 7.3。
我在 VS Code 中使用 WSL2。在 VS Code 上使用 Zsh。
我正在尝试安装 pythonnet,但遇到两个错误: 错误:为 pythonnet 构建轮子失败 错误:选项 --single-version-externally-managed 无法识别
这是使用pip install pythonnet==2.5.2
我的版本是: Python 3.8.10 车轮 0.37.0 单声道:6.8.0.105 pycparser 2.20
虽然我找不到解决方案,但我已经在网上搜索了高低 - 一切似乎都指向更新轮子和安装单声道 - 从上面的版本号可以看出,我已经安装了它们。 我在虚拟环境中做所有事情。
有没有人对此有任何经验或知道如何克服这些错误?
完整日志:
~/j/s/stx1alpha-signals/d/backend on master !6 ?1 ❯ pip install pythonnet==2.5.2 stx1alpha at 10:52:05 AM Collecting pythonnet==2.5.2 Using cached pythonnet-2.5.2.tar.gz (1.9 MB) Preparing metadata (setup.py) ... done Requirement already satisfied: pycparser in /home/jessica-ryan/jessica-ryan/stx1alpha/.venv/lib/python3.8/site-packages (from pythonnet==2.5.2) (2.20) Building wheels for collected packages: pythonnet Building wheel for pythonnet (setup.py) ... error ERROR: Command errored out with exit status 1: command: /home/jessica-ryan/jessica-ryan/stx1alpha/.venv/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/setup.py'"'"'; file='"'"'/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-789kx5l4 cwd: /tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/ Complete output (153 lines): 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 5.11.0. Update successful. MSBuild auto-detection: using msbuild version '14.0' from '/usr/lib/mono/xbuild/14.0/bin'.xbuild tool is deprecated and will be removed in future updates, use msbuild instead <<<< MSBUILD: error MSBUILD0004: Too many project files specified WARNING: Error reading msbuild project information, ensure that your input solution or project file is valid. NETCore and UAP projects will be skipped, only packages.config files will be restored.
Restoring NuGet package System.ValueTuple.4.5.0. Restoring NuGet package NUnit.ConsoleRunner.3.11.1. Restoring NuGet package NUnit.3.12.0. Restoring NuGet package UnmanagedExports.1.2.7.
Adding package 'NUnit.3.12.0' to folder '/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/packages' Adding package 'System.ValueTuple.4.5.0' to folder '/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/packages' Adding package 'UnmanagedExports.1.2.7' to folder '/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/packages' Adding package 'NUnit.ConsoleRunner.3.11.1' to folder '/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/packages' Added package 'UnmanagedExports.1.2.7' to folder '/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/packages' Added package 'System.ValueTuple.4.5.0' to folder '/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/packages' Added package 'NUnit.ConsoleRunner.3.11.1' to folder '/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/packages' Added package 'NUnit.3.12.0' to folder '/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/packages' NuGet Config files used: /home/jessica-ryan/.config/NuGet/NuGet.Config Feeds used: /home/jessica-ryan/.nuget/packages/ https://api.nuget.org/v3/index.json Installed: 4 package(s) to packages.config projectsxbuild tool is deprecated and will be removed in future updates, use msbuild instead <<<< XBuild Engine Version 14.0 Mono, Version 6.8.0.105 Copyright (C) 2005-2013 Various Mono authors Build started 11/18/2021 10:53:28. __________________________________________________ Project "/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/pythonnet.sln" (Clean target(s)): Target ValidateSolutionConfiguration: Building solution configuration "ReleaseMono|x64". Target Clean: Project "/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/src/runtime/Python.Runtime.csproj" (Clean target(s)): Target CoreClean: Deleting file '/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/src/runtime/obj/x64/ReleaseMono/.NETFramework,Version=v4.0.AssemblyAttribute.cs' Done building project "/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/src/runtime/Python.Runtime.csproj". The project 'clrmodule' is disabled for solution configuration 'ReleaseMono|x64'. Project "/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/src/testing/Python.Test.csproj" (Clean target(s)): Target CoreClean: Deleting file '/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/src/testing/obj/x64/ReleaseMono/.NETFramework,Version=v4.0.AssemblyAttribute.cs' Done building project "/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/src/testing/Python.Test.csproj". Project "/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/src/embed_tests/Python.EmbeddingTest.csproj" (Clean target(s)): Target CoreClean: Deleting file '/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/src/embed_tests/obj/x64/ReleaseMono/.NETFramework,Version=v4.0.AssemblyAttribute.cs' Done building project "/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/src/embed_tests/Python.EmbeddingTest.csproj". Project "/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/src/console/Console.csproj" (Clean target(s)): Target CoreClean: Deleting file '/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/src/console/obj/x64/ReleaseMono/.NETFramework,Version=v4.0.AssemblyAttribute.cs' Done building project "/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/src/console/Console.csproj". Done building project "/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/pythonnet.sln". Build succeeded. 0 Warning(s) 0 Error(s) Time Elapsed 00:00:00.3407830
xbuild tool is deprecated and will be removed in future updates, use msbuild instead <<<< XBuild Engine Version 14.0 Mono, Version 6.8.0.105 Copyright (C) 2005-2013 Various Mono authors Build started 11/18/2021 10:53:29. __________________________________________________ Project "/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/pythonnet.sln" (Build target(s)): Target ValidateSolutionConfiguration: Building solution configuration "ReleaseMono|x64". Target Build: Project "/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/src/runtime/Python.Runtime.csproj" (default target(s)): Target PrepareForBuild: Configuration: ReleaseMono Platform: x64 Created directory "bin/" Target GenerateSatelliteAssemblies: No input files were specified for target GenerateSatelliteAssemblies, skipping. Target CoreCompile: Tool /usr/lib/mono/4.5/mcs.exe execution started with arguments: /noconfig /debug:pdbonly /optimize+ /out:obj/x64/ReleaseMono/Python.Runtime.dll /resource:obj/x64/ReleaseMono/Python.Runtime.resources.clr.py,clr.py Codecs/EncoderGroup.cs Codecs/DecoderGroup.cs Codecs/RawProxyEncoder.cs Codecs/TupleCodecs.cs converterextensions.cs finalizer.cs Properties/AssemblyInfo.cs ../SharedAssemblyInfo.cs arrayobject.cs assemblymanager.cs BorrowedReference.cs classderived.cs classbase.cs classmanager.cs classobject.cs clrobject.cs codegenerator.cs constructorbinder.cs constructorbinding.cs converter.cs CustomMarshaler.cs debughelper.cs delegatemanager.cs delegateobject.cs eventbinding.cs eventobject.cs exceptions.cs extensiontype.cs fieldobject.cs generictype.cs genericutil.cs importhook.cs indexer.cs interfaceobject.cs interfaces.cs interop.cs iterator.cs managedtype.cs metatype.cs methodbinder.cs methodbinding.cs methodobject.cs methodwrapper.cs modulefunctionobject.cs moduleobject.cs modulepropertyobject.cs nativecall.cs NewReference.cs NonCopyableAttribute.cs overload.cs propertyobject.cs pyansistring.cs pydict.cs PyExportAttribute.cs pyfloat.cs pyint.cs pyiter.cs pylist.cs pylong.cs pynumber.cs pyobject.cs pyscope.cs pysequence.cs pystring.cs pythonengine.cs pythonexception.cs pytuple.cs ReferenceExtensions.cs runtime.cs typemanager.cs typemethod.cs Util.cs platform/Types.cs platform/LibraryLoader.cs polyfill/ReflectionPolifills.cs slots/mp_length.cs interop38.cs obj/x64/ReleaseMono/.NETFramework,Version=v4.0.AssemblyAttribute.cs /target:library /unsafe+ /define:"PYTHON38;PYTHON3;UCS4;MONO_LINUX;PYTHON_WITHOUT_ENABLE_SHARED" /nowarn:1591 /doc:bin/Python.Runtime.xml /langversion:7.3 /nostdlib /reference:/usr/lib/mono/4.0-api/System.dll /reference:/usr/lib/mono/4.0-api/System.Core.dll /reference:/usr/lib/mono/4.0-api//mscorlib.dll CSC: error CS1617: Invalid -langversion option
7.3'. It must be
ISO-1', `ISO-2', Default, Latest or value in range 1 to 7.2 Task "Csc" execution -- FAILED Done building target "CoreCompile" in project "/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/src/runtime/Python.Runtime.csproj".-- FAILED Done building project "/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/src/runtime/Python.Runtime.csproj".-- FAILED Task "MSBuild" execution -- FAILED Done building target "Build" in project "/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/pythonnet.sln".-- FAILED Done building project "/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/pythonnet.sln".-- FAILED Build FAILED. Errors: /tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/pythonnet.sln (Build) -> (Build target) ->
/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/src/runtime/Python.Runtime.csproj (default targets) ->
/usr/lib/mono/xbuild/14.0/bin/Microsoft.CSharp.targets (CoreCompile target) ->CSC: error CS1617: Invalid -langversion option `7.3'. It must be `ISO-1', `ISO-2', Default, Latest or value in range 1 to 7.2 0 Warning(s) 1 Error(s) Time Elapsed 00:00:00.3647620 Traceback (most recent call last): File "<string>", line 1, in <module> File "/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/setup.py",
第 630 行,在 设置( 文件“/home/jessica-ryan/jessica-ryan/stx1alpha/.venv/lib/python3.8/site-packages/setuptools/init.py”, 第 153 行,在设置中 return distutils.core.setup(**属性) 文件“/usr/lib/python3.8/distutils/core.py”,第 148 行,在设置中 dist.run_commands() 文件“/usr/lib/python3.8/distutils/dist.py”,第 966 行,在 run_commands 中 self.run_command(指令) 文件“/usr/lib/python3.8/distutils/dist.py”,第 985 行,在 run_command 中 cmd_obj.run() 文件“/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/setup.py”, 第 612 行,在 运行 return bdist_wheel.bdist_wheel.run(自己) 文件“/home/jessica-ryan/jessica-ryan/stx1alpha/.venv/lib/python3.8/site-packages/wheel/bdist_wheel.py”, 第 299 行,在 运行 self.run_command('build') 文件“/usr/lib/python3.8/distutils/cmd.py”,第 313 行,在 run_command 中 self.distribution.run_command(命令) 文件“/usr/lib/python3.8/distutils/dist.py”,第 985 行,在 run_command 中 cmd_obj.run() 文件“/usr/lib/python3.8/distutils/command/build.py”,第 135 行,在 运行 中 self.run_command(cmd_name) 文件“/usr/lib/python3.8/distutils/cmd.py”,第 313 行,在 run_command 中 self.distribution.run_command(命令) 文件“/usr/lib/python3.8/distutils/dist.py”,第 985 行,在 run_command 中 cmd_obj.run() 文件“/usr/lib/python3.8/distutils/command/build_ext.py”,第 340 行,在 运行 中 self.build_extensions() 文件“/usr/lib/python3.8/distutils/command/build_ext.py”,第 449 行,在 build_extensions 中 self._build_extensions_serial() 文件“/usr/lib/python3.8/distutils/command/build_ext.py”,第 474 行,在 _build_extensions_serial self.build_extension(分机) 文件“/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/setup.py”, 第 353 行,在 build_extension subprocess.check_call(" ".join(cmd + ["/t:Build"]), shell=use_shell) 文件“/usr/lib/python3.8/subprocess.py”,第 364 行,在 check_call 中 引发 CalledProcessError(retcode,cmd)subprocess.CalledProcessError:命令'xbuild pythonnet.sln /p:Configuration=ReleaseMono /p:Platform=x64 /p:DefineConstants="PYTHON38%3BPYTHON3%3BUCS4%3BMONO_LINUX%3BPYTHON_WITHOUT_ENABLE_SHARED" /p:PythonBuildDir="/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/build/lib.linux-x86_64-3.8" /p:PythonInteropFile="interop38.cs" /p:PackageId=pythonnet_py38_x64 /verbosity:normal /t:Build' returned 非零退出状态 1.
-------------------------------------- 错误:pythonnet 构建轮失败 运行 setup.py 清理 pythonnet 失败 build pythonnet 安装收集的包:pythonnet 运行 setup.py 安装 pythonnet ... 错误 错误:命令出错,退出状态为 1: 命令:/home/jessica-ryan/jessica-ryan/stx1alpha/.venv/bin/python -u -c '导入 io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/setup.py'"'"'; 文件='"'"'/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', 打开)(file) 如果os.path.exists(file) else io.StringIO('"'"'from setuptools import 设置; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(编译(代码, 文件, '"'"'exec'" '"'))' 安装 --record /tmp/pip-record-2fxmdkst/install-record.txt --single-version-externally-managed --compile --install-headers /home/jessica-ryan/jessica-ryan/stx1alpha/.venv/include/site/python3.8/pythonnet cwd: /tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/ 完整输出(6 行): 用法:setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] 或者:setup.py --help [cmd1 cmd2 ...] 或者:setup.py --help-commands 或者:setup.py cmd --helperror: option --single-version-externally-managed not recognized ---------------------------------------- ERROR: Command errored out with exit status 1:
/home/jessica-ryan/jessica-ryan/stx1alpha/.venv/bin/python -u -c '导入 io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/setup.py'"'"'; 文件='"'"'/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', 打开)(file) 如果os.path.exists(file) else io.StringIO('"'"'from setuptools import 设置; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(编译(代码, 文件, '"'"'exec'" '"'))' 安装 --record /tmp/pip-record-2fxmdkst/install-record.txt --single-version-externally-managed --compile --install-headers /home/jessica-ryan/jessica-ryan/stx1alpha/.venv/include/site/python3.8/pythonnet 检查日志以获取完整的命令输出。
您需要更新版本的 Mono。您拥有的不支持 Pythonnet 构建所需的 C# 7.3。