Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python module not found even though "Requirement Already satisfied in Pip"

writing some python in OS X, and it's saying several packages I installed with pip "ImportError: no module named requests"

When running pip install requests

> sudo -H pip install requests 
Requirement already satisfied: requests in /usr/local/lib/python2.7/site-packages 
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python2.7/site-packages (from requests) 
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /usr/local/lib/python2.7/site-packages (from requests) 
Requirement already satisfied: urllib3<1.22,>=1.21.1 in /usr/local/lib/python2.7/site-packages (from requests) 
Requirement already satisfied: idna<2.6,>=2.5 in /usr/local/lib/python2.7/site-packages (from requests)

it's erroring on twindb_cloudflare, requests, group, tarutil, and MySQL DB. I'm able to run the exact same imports on another script (in the same folder) without error.

like image 573
zoey cluff Avatar asked Jul 27 '17 08:07

zoey cluff


People also ask

How do you fix could not find a version that satisfies the requirement pip?

Step 1 – Update system. It is always a good idea to update before trying to install a new package. Step 2 – Install pip3. If Python 3 has already been installed on the system, execute the command below to install pip3: sudo apt-get -y install python3-pip.

How do I fix No module named pip error?

Solution. Well, I simply had to explicitly uninstall pipx from the old system Python version with python3. 7 -m pip uninstall pipx and then reinstall it with the new system Python version with python -m pip install --user pipx , and reinstall all pipx packages.

Why pip install module not found?

This is caused by the fact that the version of Python you're running your script with is not configured to search for modules where you've installed them. This happens when you use the wrong installation of pip to install packages.


1 Answers

Run in command prompt.

pip list

Check what version you have installed on your system if you have an old version.

Try to uninstall the package...

pip uninstall requests

Try after to install it:

pip install requests

You can also test if pip does not do the job.

easy_install requests
like image 170
Abhishek Parikh Avatar answered Oct 02 '22 04:10

Abhishek Parikh