Setup Python Development Environment - spaceshiptrip/raspberrypi GitHub Wiki

In a development environment, make sure you have the following:

  • python3
  • pip3
  • virtualenv

Steps:

  1. To install virtualenv
pip3 install --user virtualenv
  1. Set up virtualenv venv
python3 -m virtualenv venv
  1. Go into the virtualenv (defaults to bash, use appropriate source file for other shells):
source venv/bin/activate
  1. You can now program in python installing requirements specific to your program without affecting the entire system.

Install requirements.txt

If your software has a requirements.txt file, that contains all the dependencies to run your program.

  1. Install requirements.txt
pip3 install -r requirements.txt