Note: On Ubuntu, you may need to install the python3-venv
package first.
Create a setup.sh script:
#!/bin/bash # Create virtual environment python3 -m venv myenv # Activate virtual environment source myenv/bin/activate # Upgrade pip pip install --upgrade pip # Install dependencies pip install -r requirements.txt
Create a requirements.txt file:
# List your project dependencies here package_name1 package_name2
To prepare or activate:
./setup.sh
To deactivate the virtual environment:
deactivate