Skip to content

Quick Create fails to install packages #367

Description

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]

Activity

  1. karthiknadig commented on Apr 30, 2025

    @karthiknadig
    Member

    Should we just raise an error and ask the user to go through and select as a part of the resolution?

  2. eleanorjboyd commented on May 21, 2025

    @eleanorjboyd
    Member

    following up here Courtney Webster (@cwebster-99) for our desired flow for the MVP. should we opt to error if there is confusion on which to select?

  3. cwebster-99 commented on May 22, 2025

    @cwebster-99
    MemberAuthor

    I think there are two options: "fail" although the environment got created just without the packages and ask the user to select which dependency file they want to install in the environment (some drop down similar to this one) -> amend the environment by installing just that subset of packages

    Image

    OR

    We could fail / clean up and delete the environment that gets created and then ask the user to go through the custom flow.

    If we can do the first one I think I prefer that one.

  4. eleanorjboyd commented on Jun 25, 2025

    @eleanorjboyd
    Member

    think we can do the 1st, here's what I think the implementation should be. This is all specifically for the venvManager as each manager should handle its own retry or resolution loop

    if a failure occurs during quick create

    1. check to see if the environment was created (so if the .venv is there)
    2. if the error is on the packages, show a notification saying so, then include a button that is like retry dependency or package install
    3. if the user clicks that button, load the menu that shows the install dependencies or install from popular pypi packages; then after that user goes through the flow install those packages correctly in the environment they quick created
    4. if the environment wasn't created (back from step 1) show another notification that says like environment creation failed due to _____, and a button retry flow that will go back to the start of the create environment flow

    @copilot please use these steps for your implementation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

feature-requestRequest for new features or functionalityhelp wantedIssues identified as good community contribution opportunitiesneeds PR

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions