This is a simple PowerShell script to create a Python virtual environment project. Python version 3.3 or above, PowerShell, and VS Code are required. The steps to use this file are as follows:
-
Create a project folder and copy
create-venv-project-here.ps1
to it -
Run
create-venv-project-here.ps1
using the project folder as the current working directory.> powershell .\create-venv-project-here.ps1 Python 3.10.5 Creating a virtual environment ... Activating virtual environment ... Creating a requirements.txt and main.py file ... Opening VSCode ... Happy coding!
The result will be a Python virtual environment along with an empty
main.py
andrequirements.txt
file. The virtual environment may also be activated by default but sometimes VS Code has to be restarted for this to happen. -
Simply delete
create-venv-project-here.ps1
as its not longer needed.del create-venv-project-here.ps1