microsoft / microsoft/vscode-python-environments

Quick Create fails to install packages

未關閉
#367 4 則留言 1 個 reaction 已指派 1 人 在 GitHub 檢視

還沒有人認領這個 Issue。

feature-request help wanted needs PR
主要語言
TypeScript
星號
138
分支
62
平均合併
1 天 4 小時
30 天內合併 PR
35

描述

I am tried to run Quick Create at the root of vscode-python-templates and package install failed. Is this because it is using all requirements files and cannot resolve?

The environment still got created just not with the packages. I had to reference the environment managers venv list in order for the environment to show up in this case. How can we better resolve the environment in this scenario?

If there are multiple requirements files should we be attempting to install everything with Quick Create?

Output 2025-04-29 14:56:23.006 [info] python: Getting requirements to build editable: started

2025-04-29 14:56:23.465 [info] python: Getting requirements to build editable: finished with status 'error'

2025-04-29 14:56:23.470 [info] python: error: subprocess-exited-with-error

2025-04-29 14:56:23.471 [info] python: Getting requirements to build editable did not run successfully.
exit code: 1

[54 lines of output]
configuration error: project.name must be pep508-identifier
DESCRIPTION:
The name (primary identifier) of the project. MUST be statically defined.

GIVEN VALUE:
"Package Template"

OFFENDING RULE: 'format'

DEFINITION:
{
"type": "string",
"format": "pep508-identifier"
}

For more details about format see
https://validate-pyproject.readthedocs.io/en/latest/api/validate_pyproject.formats.html

Traceback (most recent call last):
File "C:\vscode-python-templates-main.venv\Lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 389, in

2025-04-29 14:56:23.471 [info] python: main()
File "C:\vscode-python-templates-main.venv\Lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 373, in main
json_out["return_val"] = hook(**hook_input["kwargs"])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\vscode-python-templates-main.venv\Lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 157, in get_requires_for_build_editable
return hook(config_settings)
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\cowebster\AppData\Local\Temp\pip-build-env-q6fcdwnm\overlay\Lib\site-packages\setuptools\build_meta.py", line 473, in get_requires_for_build_editable
return self.get_requires_for_build_wheel(config_settings)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\cowebster\AppData\Local\Temp\pip-build-env-q6fcdwnm\overlay\Lib\site-packages\setuptools\build_meta.py", line 331, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=[])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\cowebster\AppData\Local\Temp\pip-build-env-q6fcdwnm\overlay\Lib\site-packages\setuptools\build_meta.py", line 301, in get_build_requires
self.run_setup()
File "C:\Users\cowebster\AppData\Local\Temp\pip-build-env-q6fcdwnm\overlay\Lib\site-packages\setuptools\build_meta.py", line 317, in run_setup
exec(code, locals())
File "", line 1, in
File "C:\Users\cowebster\AppData\Local\Temp\pip-build-env-q6fcdwnm\overlay\Lib\site-packages\setuptools_init
.py", line 117, in setup
return distutils.core.setup(**attrs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\cowebster\AppData\Local\Temp\pip-build-env-q6fcdwnm\overlay\Lib\site-packages\setuptools_distutils\core.py", line 160, in setup
dist.parse_config_files()
File "C:\Users\cowebster\AppData\Local\Temp\pip-build-env-q6fcdwnm\overlay\Lib\site-packages\setuptools\dist.py", line 756, in parse_config_files
pyprojecttoml.apply_configuration(self, filename, ignore_option_errors)
File "C:\Users\cowebster\AppData\Local\Temp\pip-build-env-q6fcdwnm\overlay\Lib\site-packages\setuptools\config\pyprojecttoml.py", line 72, in apply_configuration
config = read_configuration(filepath, True, ignore_option_errors, dist)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\cowebster\AppData\Local\Temp\pip-build-env-q6fcdwnm\overlay\Lib\site-packages\setuptools\config\pyprojecttoml.py", line 140, in read_configuration
validate(subset, filepath)
File "C:\Users\cowebster\AppData\Local\Temp\pip-build-env-q6fcdwnm\overlay\Lib\site-packages\setuptools\config\pyprojecttoml.py", line 61, in validate
raise ValueError(f"{error}\n{summary}") from None
ValueError: invalid pyproject.toml config: project.name.
2025-04-29 14:56:23.471 [info] python:
configuration error: project.name must be pep508-identifier
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.

2025-04-29 14:56:24.039 [info] python:
[notice] A new release of pip is available: 25.0.1 -> 25.1
[
2025-04-29 14:56:24.039 [info] python: notice] To update, run: C:\vscode-python-templates-main.venv\Scripts\python.exe -m pip install --upgrade pip

2025-04-29 14:56:24.041 [info] python: error: subprocess-exited-with-error

Getting requirements to build editable did not run successfully.
exit code: 1

See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

2025-04-29 14:56:24.250 [error] Error managing packages Failed to run python -m pip install -r c:\vscode-python-templates-main\data-science-template\dev-requirements.txt -r c:\vscode-python-templates-main\data-science-template\requirements.txt -r c:\vscode-python-templates-main\django-template\requirements.txt -r c:\vscode-python-templates-main\fastapi-template\dev-requirements.txt -r c:\vscode-python-templates-main\fastapi-template\requirements.txt -r c:\vscode-python-templates-main\flask-template\dev-requirements.txt -r c:\vscode-python-templates-main\flask-template\requirements.txt -r c:\vscode-python-templates-main\package-template\dev-requirements.txt -r c:\vscode-python-templates-main\script-template\dev-requirements.txt -e c:\vscode-python-templates-main\package-template -e .[dev-requirements] -e .[dev-requirements] -e .[dev-requirements]
2025-04-29 14:56:24.252 [error] Failed to create virtual environment: Error: Failed to run python -m pip install -r c:\vscode-python-templates-main\data-science-template\dev-requirements.txt -r c:\vscode-python-templates-main\data-science-template\requirements.txt -r c:\vscode-python-templates-main\django-template\requirements.txt -r c:\vscode-python-templates-main\fastapi-template\dev-requirements.txt -r c:\vscode-python-templates-main\fastapi-template\requirements.txt -r c:\vscode-python-templates-main\flask-template\dev-requirements.txt -r c:\vscode-python-templates-main\flask-template\requirements.txt -r c:\vscode-python-templates-main\package-template\dev-requirements.txt -r c:\vscode-python-templates-main\script-template\dev-requirements.txt -e c:\vscode-python-templates-main\package-template -e .[dev-requirements] -e .[dev-requirements] -e .[dev-requirements]

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。