Resolved – ImportError: No module named requests | /usr/bin/python: No module named pip on MacOS

Topic General

You may face an error while running the script which calls any python script which internally calls out requests module.

ImportError: No module named requests”

When you verify you can see – you already have python installed

Try to search for the module, if it is installed or not

Login to Python console and List out the modules (Once done press Cntrl + D )

Once we go through the list, we found that the module is missing.

Now lets install it through Python

Ohhh ….. pip itself seems to be missing  “/usr/bin/python: No module named pip”

Lets install pip through easy_installEasy Install is a python module ‘easy_install’ bundled with ‘setuptools that lets you automatically download, build, install, and manage Python packages )

You need to use sudo since it requires admin permission to make the system changes

Now lets try again to install requests module

Fantastic – Now both pip and requests are installed – You can verify the module list through pip

Now try to run the same script where you were getting requests module error – This time it should run without any issue.

You have now successfully resolved the python module issue.

Happy learning ……

0 comments… add one

Leave a Comment