What are pip and PyPI?
Options
- pip installs Python packages; PyPI is the online repository they come from (Correct option)
- pip is a text editor for Python files; PyPI is a kind of database
- pip runs the tests of a project; PyPI deploys the application
- pip is the Python interpreter; PyPI is the debugger that goes with it
Answer
pip installs Python packages; PyPI (Python Package Index) is the online repository where they come from
Why
pip is the tool you run to install, upgrade and remove packages. By default it downloads them from PyPI, the public index at pypi.org.
Example: python -m pip install requests.
A virtual environment (python -m venv .venv) keeps each project's packages separate, and pip freeze > requirements.txt records the list for others.
Remember
pip installs. PyPI is where packages live.