Python is famous for having many package and environment managers.

  • pip is the default, index: PyPI (python package index)
  • conda also does other language dependencies, index: Anaconda Repo, conda-forge Python environment is a directory with:
  1. Binaries in bin: interpreter
  2. Standard lib in lib
  3. 3rd party packages in site-packages
    1. when you are making a python package you also You can {python}import packages (directory) or modules (single file)
  • Python packages have directory structures under mypackage
    1. pyproject.toml or setup.py: package name & build configuration
    2. src/mypackage
      1. __init__.py is required to make it a package
      2. __main__.py is optional, allows running by python -m mypackage
      3. ./subpackage to be imported like {python}import mypackage.subpackage
  • Python modules are the single file mymodule.py anc imported {python}import mymodule