About the Preference of *.pth Files

When you develop a third-party Python module and also have it installed in some of your projects, you can switch between the pip-installed package and the development version of the third-party module by creating a *.pth file with the absolute path to your development version.

For example, create django_myapp.pth in your site-packages with this content:

1
/Users/me/Projects/django-myapp

To use the pip-installed version, comment out the path in the django_myapp.pth file:

1
# /Users/me/Projects/django-myapp

Tips and Tricks Programming Django 5.x Django 4.2 Django 3.2 Python 3