Complete Steps for New Project using Virtual Environment

It is necessary to make it systematic. Plan to do AI projects, CAD, PCB software etc. and enhance the working app as a site people want to go and stay.

To create a new project in a separate venv, here is the steps:

pip install virtualenv
mkdir my_new_project
cd my_new_project
virtualenv venv

# For cmd.exe
venv\Scripts\activate
# For PowerShell
venv\Scripts\Activate.ps1
# For Bash on Windows
source venv/Scripts/activate

pip install some_package_name
pip freeze > requirements.txt
pip install -r requirements.txt

deactivate


Commit to Version Control: If you're using version control (like git), remember to commit requirements.txt so others can recreate your environment. Typically, you would not commit the entire virtual environment directory (e.g., venv/); instead, add it to .gitignore.

Note Git is initialized at the root folder where requirements.txt is stored. to check if it’s initialized, use git status.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.