Python Forum
I cannot create a virtual environment on visual studio code using python
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I cannot create a virtual environment on visual studio code using python
#1
Hello everyone, I am completely new and just wanted to start a virtual environment using python on visual studio code. After opening a new terminal I typed the following which gave an error code.

PS C:\Users\Willem\Desktop\Willem Stats\Simple_Flask_App> python -m venv venv
Error: Command '['C:\\Users\\Willem\\Desktop\\Willem Stats\\Simple_Flask_App\\venv\\Scripts\\python.exe', '-m', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1.

I tried unistalling/deleting python and redownlading making sure I allow the correct PATH. With no avail.
After getting a series of prompts from chatgpt, the error still have not been solved.

My brain is mush and I don't know how to get this solved. Please help! Confused
Reply
#2
Try py -m venv venv in a Powershell window (launched outside of VS Code).
I am trying to help you, really, even if it doesn't always seem that way
Reply
#3
Open a folder with then pust ctrl+shift+p a propt will open start typing venv. Should pull it up before finished typing. select venv select python version and it should install the virtual environment.
I welcome all feedback.
The only dumb question, is one that doesn't get asked.
My Github
How to post code using bbtags
Download my project scripts


Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Python use of virtual environments bre67e49 4 735 Feb-19-2025, 04:01 AM
Last Post: Sece1967
  Visual Studio Code help aaronrousch 4 3,783 Jan-25-2025, 05:55 AM
Last Post: ndc85430
  How to enable Matplotlib within virtual environment? tetris_theMovie 1 1,071 Oct-11-2024, 09:56 AM
Last Post: christie2
  Code Completion in Visual Studio for External Libraries mjakov 0 577 Aug-25-2024, 02:48 PM
Last Post: mjakov
  Need help setting up trusted root ca in virtual environment dstempfley 0 1,210 May-31-2024, 03:14 PM
Last Post: dstempfley
  How does this code create a class? Pedroski55 6 1,976 Apr-21-2024, 06:15 AM
Last Post: Gribouillis
  Help with creating folder and "virtual environment" AudunNilsen 1 990 Mar-21-2024, 04:41 AM
Last Post: deanhystad
  Best practice on using virtual environments in Python bytecrunch 6 13,864 Feb-14-2024, 03:22 PM
Last Post: snippsat
  Python Coding in Power BI Visual vjrans 0 788 Jan-31-2024, 07:54 AM
Last Post: vjrans
  Virtual Env changing mysql connection string in python Fredesetes 0 966 Dec-20-2023, 04:06 PM
Last Post: Fredesetes

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020