1

I am trying to use the requests module in a python script. I start by the import command and write the script however it is telling me that requests is not a module. Can anyone explain this to me? Is this not built in like "re" or do I have to import it in? I am new to python so any help would be great. Using Windows!

Thanks

Deirdre

1 Answer 1

1

No, requests is a 3rd party library. You can install it using pip.

pip install requests

And even if re is built-in, you have to import it in order to use it.

Sign up to request clarification or add additional context in comments.

5 Comments

I am having problems with installing pip, I am using version 2.7.6 so I have to install it when I copy the file onto the notepad and save it as a py file a message come up about encoding so it wont allow me to run. any suggestions I'm am really struggling at this
@Deirdre pip install requests is a terminal command, it's not Python code. It looks like you're using Windows, so run it in the command prompt. You may need to have Admin privileges (I don't use Windows).
yes I have that but for some reason when I go to install the pip package it just wont work for me, when I click on the pip installation a file opens with pages of binary information.. so I am wondering if anyone else has encountered this
What do you mean by "wont work for me"? Does it still throw the same error? Did you do import requests?
Ok I got it, thanks.. I have installed requests successfully. thanks you

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.