Ensure you have:
- Python installed (Download)
- VS Code installed (Download)
- Git installed (Download)
- Python extension installed in VS Code
Before setting up the virtual environment, clone your project from GitHub:
git clone https://github.com/your-username/your-repo.git
cd your-repoInside the cloned repository, run:
python -m venv .venvThis creates a virtual environment named venv.
venv\Scripts\Activatesource venv/bin/activate- Press
Ctrl + Shift + P(orCmd + Shift + Pon Mac). - Search for "Python: Select Interpreter".
- Choose the one inside
venv(e.g.,.venv/bin/python).
If your project has dependencies listed in requirements.txt, install them:
pip install -r requirements.txtTo save installed packages for future use:
pip freeze > requirements.txtExit the virtual environment by running:
deactivate- If
venv\Scripts\Activateis not working on Windows, run:Set-ExecutionPolicy Unrestricted -Scope Process
You have successfully:
✅ Cloned your GitHub repository.
✅ Set up a Python virtual environment in VS Code.
✅ Installed dependencies and configured the workspace.
Now, you can start coding in an isolated environment! 🚀
Would you like a script to automate this setup? 😃