1

So I keep getting this error everytime I try to run my python script.

import requests
ImportError: No module named requests

I have checked all the answers to this issue in other previous questions asked. I have done all the solutions, made sure it was python2.7, installed the requests. Yet every time I run it it still gives me that same error.

I have run

sudo install requests

and

easy_install -U requests

its all there, yet not functioning.

Is there something I am missing?

The only thing that seems off is I have 1 folder labeled requests and another labeled requests-2.11.1-py2.7.egg that both seem to have the same content inside them.

closed as off-topic by Gilles, Eric Renouf, Jeff Schaller, Anthon, Scott Aug 24 '16 at 8:15

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions describing a problem that can't be reproduced and seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – Gilles, Eric Renouf, Jeff Schaller, Anthon, Scott
If this question can be reworded to fit the rules in the help center, please edit the question.

  • What distribution of Linux? Are you using its 'system' version of python, or have you installed a 3rd party version and/or created a virtualenv? – steeldriver Aug 23 '16 at 16:25
  • @steeldriver Darwin Kernel 16.0.0, I installed python using Xcode – lwaskie Aug 23 '16 at 16:45
  • Xcode and Homebrew – lwaskie Aug 23 '16 at 16:53
1

So my issue was that I was using a cron, and the cron was specifying the script to use python version 2.7.10. And the script was trying to use version 2.7.12.

Specified crontab to use correct version, worked fine.

Not the answer you're looking for? Browse other questions tagged or ask your own question.