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.
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.
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.
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.
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
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