Skip to content

Log indicates failure but .venv folder has been created #19889

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jrieken opened this issue Sep 27, 2022 · 3 comments · Fixed by #19925
Closed

Log indicates failure but .venv folder has been created #19889

jrieken opened this issue Sep 27, 2022 · 3 comments · Fixed by #19925
Assignees
Labels
area-environments Features relating to handling interpreter environments bug Issue identified by VS Code Team member as probable bug needs PR Ready to be worked on verified Verification succeeded

Comments

@jrieken
Copy link
Member

jrieken commented Sep 27, 2022

Testing #19883

I am no expert in this and don't really know what success means but I went through the "create env > venv" flow, everything seemed file but checking the logs it reads:

Experiment 'pythonSurveyNotificationcf' is active
LSP Notebooks experiment is enabled
LSP Notebooks interactive window support is enabled
> conda info --json
> /bin/python3 ~/.vscode-insiders/extensions/ms-python.python-2022.15.12701023/pythonFiles/get_output_via_markers.py ~/.vscode-insiders/extensions/ms-python.python-2022.15.12701023/pythonFiles/interpreterInfo.py
> /usr/bin/python3 ~/.vscode-insiders/extensions/ms-python.python-2022.15.12701023/pythonFiles/get_output_via_markers.py ~/.vscode-insiders/extensions/ms-python.python-2022.15.12701023/pythonFiles/interpreterInfo.py
Python interpreter path: /bin/python3
Starting Pylance language server.
Running Env creation script:  [
  '/bin/python3',
  '/home/parallels/.vscode-insiders/extensions/ms-python.python-2022.15.12701023/pythonFiles/create_venv.py',
  '--git-ignore',
  '--install'
]
Running: /bin/python3 -m venv .venv

The virtual environment was not created successfully because ensurepip is not
available.  On Debian/Ubuntu systems, you need to install the python3-venv
package using the following command.

    apt install python3.8-venv

You may need to use sudo with that command.  After installing the python3-venv
package, recreate your virtual environment.

Failing command: ['/home/parallels/Code/_samples/.venv/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-pip']


Traceback (most recent call last):
  File "/home/parallels/.vscode-insiders/extensions/ms-python.python-2022.15.12701023/pythonFiles/create_venv.py", line 60, in run_process
    subprocess.run(args, cwd=os.getcwd(), check=True)
  File "/usr/lib/python3.8/subprocess.py", line 516, in run

    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/bin/python3', '-m', 'venv', '.venv']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/parallels/.vscode-insiders/extensions/ms-python.python-2022.15.12701023/pythonFiles/create_venv.py", line 130, in <module>
    main(sys.argv[1:])
  File "/home/parallels/.vscode-insiders/extensions/ms-python.python-2022.15.12701023/pythonFiles/create_venv.py", line 115, in main

    run_process(
  File "/home/parallels/.vscode-insiders/extensions/ms-python.python-2022.15.12701023/pythonFiles/create_venv.py", line 62, in run_process
    raise VenvError(error_message)
__main__.VenvError: CREATE_VENV.VENV_FAILED_CREATION

> ./.venv/bin/python ~/.vscode-insiders/extensions/ms-python.python-2022.15.12701023/pythonFiles/get_output_via_markers.py ~/.vscode-insiders/extensions/ms-python.python-2022.15.12701023/pythonFiles/interpreterInfo.py
Running Env creation script:  [
  '/bin/python3',
  '/home/parallels/.vscode-insiders/extensions/ms-python.python-2022.15.12701023/pythonFiles/create_venv.py',
  '--git-ignore',
  '--install'
]
CREATED_VENV:/home/parallels/Code/_samples/.venv/bin/python

Traceback (most recent call last):
  File "/home/parallels/.vscode-insiders/extensions/ms-python.python-2022.15.12701023/pythonFiles/create_venv.py", line 130, in <module>
    main(sys.argv[1:])
  File "/home/parallels/.vscode-insiders/extensions/ms-python.python-2022.15.12701023/pythonFiles/create_venv.py", line 124, in main
    install_packages(venv_path)
  File "/home/parallels/.vscode-insiders/extensions/ms-python.python-2022.15.12701023/pythonFiles/create_venv.py", line 76, in install_packages

    raise VenvError("CREATE_VENV.PIP_NOT_FOUND")
__main__.VenvError: CREATE_VENV.PIP_NOT_FOUND


Now I am confused I don't know if this was successful or not

@jrieken jrieken changed the title Log indicate failure but .venv folder has been created Log indicates failure but .venv folder has been created Sep 27, 2022
@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Sep 27, 2022
@karthiknadig
Copy link
Member

@jrieken In this case the environment is created and can be used. But packages cannot be installed in it. We will attempt to discover this earlier and try to fail the whole env creation process.

@karthiknadig karthiknadig added this to the September 2022 milestone Sep 28, 2022
@karthiknadig karthiknadig added bug Issue identified by VS Code Team member as probable bug area-environments Features relating to handling interpreter environments needs PR Ready to be worked on and removed triage-needed Needs assignment to the proper sub-team labels Sep 28, 2022
karthiknadig added a commit that referenced this issue Oct 3, 2022
Closes #19889
Closes #19890
Closes #19891
Closes #19894
Closes #19897
Closes #19852
Closes #19851
Closes #19838
Closes #19916
Closes #19917
eleanorjboyd pushed a commit to eleanorjboyd/vscode-python that referenced this issue Oct 4, 2022
@TylerLeonhardt
Copy link
Member

What's the best way to verify this?

@TylerLeonhardt TylerLeonhardt added the verification-steps-needed Steps to verify are needed for verification label Oct 4, 2022
@karthiknadig
Copy link
Member

karthiknadig commented Oct 4, 2022

You have to force a failure in create_venv.py script where it checks for is_installed('pip'). @eleanorjboyd verified this manually. Forgot to mark this as verified.

@karthiknadig karthiknadig added verified Verification succeeded and removed verification-steps-needed Steps to verify are needed for verification labels Oct 4, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-environments Features relating to handling interpreter environments bug Issue identified by VS Code Team member as probable bug needs PR Ready to be worked on verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants