In Pycharm I wrote:
import requests
url = 'https://www.w3schools.com/python/demopage.php'
myobj = {'somekey': 'somevalue'}
x = requests.post(url, data = myobj)
#print the response text (the content of the requested file):
print(x.text)
But I am getting the following error:
/Users/me/PycharmProjects/RegMe/venv/bin/python /Users/me/PycharmProjects/RegMe/main.py
Traceback (most recent call last):
File "/Users/me/PycharmProjects/RegMe/main.py", line 1, in <module>
import requests
ModuleNotFoundError: No module named 'requests'
Process finished with exit code 1
I am working on macOS big Sur, and latest version of python (python 3.9). Plus I have already installed the needed package like this:
python3 -m pip install requests
and also tried this:
pip3 install requests
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…