分页: 1 / 1

安装torchvision时的报错

发表于 : 2025-04-23 8:23
SZZ504232
File "/home/dc/.local/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 157, in setup
dist.parse_config_files()
File "/home/dc/.local/lib/python3.8/site-packages/setuptools/dist.py", line 655, in parse_config_files
pyprojecttoml.apply_configuration(self, filename, ignore_option_errors)
File "/home/dc/.local/lib/python3.8/site-packages/setuptools/config/pyprojecttoml.py", line 71, in apply_configuration
config = read_configuration(filepath, True, ignore_option_errors, dist)
File "/home/dc/.local/lib/python3.8/site-packages/setuptools/config/pyprojecttoml.py", line 139, in read_configuration
validate(subset, filepath)
File "/home/dc/.local/lib/python3.8/site-packages/setuptools/config/pyprojecttoml.py", line 60, in validate

raise ValueError(f"{error}\n{summary}") from None

ValueError: invalid pyproject.toml config: `project.license`.

configuration error: `project.license` must be valid exactly by one definition (2 matches found): - keys:

'file': {type: string}

required: 【'file'】

- keys:

'text': {type: string}

required: 【'text'】

求解 :Cry

pyproject.toml是这样的

发表于 : 2025-04-23 20:08
SZZ504232
[tool.usort]

first_party_detection = false

[tool.black]

line-length = 120
target-version = ["py38"]

[tool.ufmt]

excludes = [
"gallery",
]

[build-system]

requires = ["setuptools", "torch", "wheel"]
~
~
~
~
~
"pyproject.toml" 18L, 208C

Re: 安装torchvision时的报错

发表于 : 2025-04-24 20:47
SZZ504232
我听从gpt的建议用pip install . --user
问题解决了