.. _pip: ========== pip ========== .. attention:: Remember to check the correct :ref:`virtualenv` is activated before using pip to install software. Installing apps =================== There are various pip commands but the most useful is:: pip install APP_NAME Existing project -------------------- If you have downloaded an existing project with a requirements file already, navigate to the folder containing the requirements file then:: pip install -r requirements.txt Uninstalling apps ===================== To uninstall an app:: pip uninstall APP_NAME If you are developing a Django app and want to remove an app as well as tables it has created in the database:: python manage.py sqlclear APP_NAME pip uninstall APP_NAME .. note:: If that gives an error about migrations, delete the migrations folder then try again. Updates ============== To update your requirements list with the latest packages:: pip freeze > requirements.txt To update pip:: pip install --upgrade pip To find packages that are out of date:: pip list --outdated --format=columns To update a package:: pip install -U APP_NAME Requirements consideration -------------------------- Some people recommend using ``pip freeze`` however there is a downside to it. All dependencies are listed as well which can make upgrading more complicated. Another approach is to manually add each package you install, with the version number, to ``requirements.txt``. When you update that package, any updated dependencies will also be installed. You can then manually edit the ``requirements.txt`` with the new version. This makes for a much cleaner list of requirements with upgrades simpler.