To install packages using pip
, follow these steps:
- Open the command line or terminal on your system.
- Ensure
pip
is installed by typingpip --version
. If it’s not installed, download and install Python from python.org, which includespip
by default. - To install a package, use the command:
pip install package_name
Replace
package_name
with the desired package, e.g.,pip install numpy
. - For specific versions, use:
pip install package_name==version_number
- To upgrade a package:
css
pip install --upgrade package_name
This allows you to install, upgrade, or manage Python packages.