Whenever I run
pypy test.py
in the Mac OS X 10 Terminal, I get a
File "test.py", line 8, in <module>
import requests
ImportError: No module named requests
However, this works well and without any errors when I do
python test.py
and when I open up pip (and also pip3), it shows me that Requests2.9.1 was installed.
What could be a possibly causing the problem? I am happy about really any ideas or suggestions! Thank you very much in advance
Requests are not a built-in module (it doesn't come with the default python installation) in Python, you need to install it explicitly using the pip installer and then use it. If you are getting an error installing pip checkout pip: command not found to resolve the issue.
Requests is released under the Apache License 2.0. Requests is one of the most popular Python libraries that is not included with Python.
Like others alluded to, PyPy needs its own install of Pip.
Check if your PyPy install directory contains a pip executable in the /bin directory. If not, download get-pip and run it using PyPy. Then, you run this version of Pip and install requests. Then you're good to go!
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