# in a virtual environment or using Python 2
pip install requests
# for python 3 (could also be pip3.10 depending on your version)
pip3 install requests
# if you get permissions error
sudo pip3 install requests
pip install requests --user
# if you don't have pip in your PATH environment variable
python -m pip install requests
# for python 3 (could also be pip3.10 depending on your version)
python3 -m pip install requests
# using py alias (Windows)
py -m pip install requests
# alternative for Ubuntu/Debian
sudo apt-get install python3-requests
# alternative for CentOS
sudo yum install python-requests
# for Anaconda
conda install -c anaconda requests
# for Jupyter Notebook
!pip install requests
没有评论