I am trying to install the requests package for Python 3.7 on Mac. I already have python 2.7 installed. I have read all the previous questions related to this and none of them could solve the issue.
pip3.7 install requests
bash: pip3.7: command not found
python3.7 -m pip install requests
/usr/local/bin/python3.7: No module named pip
I am not able to understand the issue here.
If you installed python3 via brew, installing python libs globally is not allowed anymore:
pip3 install requests
Fails with the error: "This environment is externally managed"
brew install python-requests
Fails with the error: "Error: python-requests has been disabled because it does not meet homebrew/core's requirements for Python library formulae! It was disabled on 2024-06-23"
Solution: Luckily the solution is stated in the first error message, you have to create a virtual environment instead of a globally installed lib with:
python3 -m venv path/to/venv
source path/to/venv/bin/activate
python3 -m pip install requests
There’s no “pip3.7”, just “pip3”. Try this: pip3 install requests
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With