0
I want to import the module requests
from Python to a program I’m doing, but it doesn’t stop giving the following error, so I run the program:
ModuleNotFoundError: No module named 'requests'
I have the latest version of Python installed (reinstalled direct from the official website yesterday) and already entered the command sudo pip install requests
in the Terminal of my Macos to install the module. The module is already installed.
I don’t know if maybe I need to put the module folder in the same folder as my program... I don’t know where to find the module folder anyway.
I’m new, so I’m sorry for the ignorance.
Follow the code of my program.
import requests
#meu programa
And my program (the archive .py) is located directly on the Desktop (Desktop) of my Mac.
Where is my mistake?
Thank you!
It is likely that you have more than one python environment and Pip is installing in a different one. To get rid of problems with managing envs, consider installing anacoda. For installation on mac, see this answer., to supplement the introduction to anaconda, see this one.
– Sidon
I agree with Sidon and if the "anacoda" or "anaconda" doesn’t work you can try the
virtualenv
.– Fernando Silveira
Ever tried to spin
pip install request
withoutsudo
and see if it works?– fernandosavio