Skip to content

Test: Selecting requirement files while using Create Environment command #20548

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
3 tasks done
karthiknadig opened this issue Jan 23, 2023 · 4 comments
Closed
3 tasks done

Comments

@karthiknadig
Copy link
Member

karthiknadig commented Jan 23, 2023

Refs: #20277

Complexity: 2

Create Issue


Requirements

  1. Latest pre-release of the python extension.
  2. A global Python 3.7 or greater.

Verification

  1. Create a folder or open a project containing requirement files.
  2. Run the Python: Create Environment command.
  3. Select Venv option
  4. Select a global python.
  5. It should show you requirements.txt files found in the project.
  6. You should be able select one, multiple or none.
  7. Look at the logs to ensure all the requirements were installed.

NOTE: If you want to retest with different combination of requirements.txt etc, please delete the .venv manually.

@karthiknadig karthiknadig added this to the January 2023 milestone Jan 23, 2023
@sandy081 sandy081 removed their assignment Jan 24, 2023
@lramos15
Copy link
Member

For those who don't have python projects, I tried some from here https://github.com/geekcomputers/Python

@lramos15 lramos15 removed their assignment Jan 24, 2023
@digitarald
Copy link

The first call failed. This was a fresh Python install in my Windows VM. Later calls worked fine. Maybe it had a race condition to install pip?

Traceback (most recent call last):
  File "c:\Users\Harald Kirschner\.vscode-insiders\extensions\ms-python.python-2023.1.10241007\pythonFiles\create_venv.py", line 75, in run_process

    subprocess.run(args, cwd=os.getcwd(), check=True)
  File "C:\Users\Harald Kirschner\AppData\Local\Programs\Python\Python311\Lib\subprocess.py", line 571, in run

    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['\\\\Mac\\Home\\Documents\\Python-master\\.venv\\Scripts\\python.exe', '-m', 'pip', 'install', '-r', '\\\\Mac\\Home\\Documents\\Python-master\\wiki\\requirements.txt']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\Users\Harald Kirschner\.vscode-insiders\extensions\ms-python.python-2023.1.10241007\pythonFiles\create_venv.py", line 167, in <module>

    main(sys.argv[1:])
  File "c:\Users\Harald Kirschner\.vscode-insiders\extensions\ms-python.python-2023.1.10241007\pythonFiles\create_venv.py", line 159, in main
    install_requirements(venv_path, args.requirements)
  File "c:\Users\Harald Kirschner\.vscode-insiders\extensions\ms-python.python-2023.1.10241007\pythonFiles\create_venv.py", line 97, in install_requirements

    run_process(
  File "c:\Users\Harald Kirschner\.vscode-insiders\extensions\ms-python.python-2023.1.10241007\pythonFiles\create_venv.py", line 77, in run_process
    raise VenvError(error_message)

VenvError: CREATE_VENV.PIP_FAILED_INSTALL_REQUIREMENTS

@digitarald digitarald removed their assignment Jan 25, 2023
@karthiknadig
Copy link
Member Author

@digitarald A full log might have helped here I think. But, likely it is a transient issue. The command itself seems correct.

@lramos15
Copy link
Member

The first call failed. This was a fresh Python install in my Windows VM. Later calls worked fine. Maybe it had a race condition to install pip?

Traceback (most recent call last):
  File "c:\Users\Harald Kirschner\.vscode-insiders\extensions\ms-python.python-2023.1.10241007\pythonFiles\create_venv.py", line 75, in run_process

    subprocess.run(args, cwd=os.getcwd(), check=True)
  File "C:\Users\Harald Kirschner\AppData\Local\Programs\Python\Python311\Lib\subprocess.py", line 571, in run

    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['\\\\Mac\\Home\\Documents\\Python-master\\.venv\\Scripts\\python.exe', '-m', 'pip', 'install', '-r', '\\\\Mac\\Home\\Documents\\Python-master\\wiki\\requirements.txt']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\Users\Harald Kirschner\.vscode-insiders\extensions\ms-python.python-2023.1.10241007\pythonFiles\create_venv.py", line 167, in <module>

    main(sys.argv[1:])
  File "c:\Users\Harald Kirschner\.vscode-insiders\extensions\ms-python.python-2023.1.10241007\pythonFiles\create_venv.py", line 159, in main
    install_requirements(venv_path, args.requirements)
  File "c:\Users\Harald Kirschner\.vscode-insiders\extensions\ms-python.python-2023.1.10241007\pythonFiles\create_venv.py", line 97, in install_requirements

    run_process(
  File "c:\Users\Harald Kirschner\.vscode-insiders\extensions\ms-python.python-2023.1.10241007\pythonFiles\create_venv.py", line 77, in run_process
    raise VenvError(error_message)

VenvError: CREATE_VENV.PIP_FAILED_INSTALL_REQUIREMENTS

I got this same error, but thought it was due to a bad requirements file as I'm not sure what the requirements file needs. It worked on the second try, but with a different requirements.txt

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants