Make Sagelib a pip-installable Python source package, listed on PyPI (2016)
Then a simple
would install sagelib in the user’s Python installation. If SAGE_LOCAL is not set, then sagelib will discover system packages and Python packages installed in standard places. At this point, sagelib will be a standard pip-installable Python source package, ready for upload to PyPI.
Source: trac.sagemath.org