Cannot import requests after using 'pip3 install requests' - python

I am trying to import 'requests' in my python code(Python 3.5.2). I did the following:
first downloaded get-pip.py, and install it using python shell
then in my cmd directory for scripts: C:\Users\Juan\AppData\Local\Programs\Python\Python35-32\Scripts>, I typed "pip3 install requests". I got no error message for this step, and no message telling me the installation is successful either.
However, when run my python code, still got error File "C:/pycode/dl_proxy3.py", line 2, in <module>
import requests
ImportError: No module named 'requests'
Can't figure out what's the problem. Why the requests module still not installed.

Related

Issues with vartest package - Python

I tried to install the vartests package in Python with the following command:
pip install vartests
and, by using pip list, it shows that the package is installed.
However, by importing the module I receive the following error message:
import vartests
ModuleNotFoundError: No module named 'vartests'
Do you know why it's not working?
Many thanks

Why isn't the requests library working after being installed?

I have imported the requests package (pip install requests) and it shows when I run pip list, but when I run code that uses import requests, it gives me the error "ModuleNotFoundError: No module named 'requests'". I've tried updating pip but so far nothing has worked.

Module is not found after import and download

I just switched my code from Replit to Visual Code Studio and I have pip, python, and discord.py installed. I also installed requests by doing pip install requests and it downloaded it fine. Whenever i run the code, i get this error. How can i fix this issue?
File "c:\Users\colee\Desktop\Ultimate Bot\main.py", line 5, in <module>
import requests
ModuleNotFoundError: No module named 'requests'
This is my import,
import requests

ModuleNotFoundError after installing requests package

I am on Mac OS Sierra, with home-brew, pip and python3 installed. I Tried running a script that required the requests module, but I keep getting this error:
Traceback (most recent call last):
File "listing_seq.py", line 1, in <module>
import requests
ModuleNotFoundError: No module named 'requests'
Despite running:
sudo pip3 install requests
sudo pip install requests
sudo pip install requests --upgrade
Any suggestions?
Update:
When I try running using virtualenv I get:
Running virtualenv with interpreter /usr/local/bin/python3
ERROR: File already exists and is not a directory.
Please provide a different path or delete the file.
The most common error is having another file with the name of any of the libraries you requested in the same path.
The other possible error is if the python you are using to execute the file is not python 3 but rather the defalut python from your OSX. See the accepted answer on this for better understanding of a possible issue. Also share your code to identify the bug.

Python request module not working

I installed Python using Homebrew, I installed Pip and then using Pip I downloaded the Requests module.
Just to double check I tried to install it again and got a confirmation in terminal that it was already installed:
Requirement already satisfied: requests in /usr/local/lib/python2.7/site-packages
I then tried to write a pretty simple script to call Git and see if I can get a response. But when I run it I get an error message. Here's the script and message:
import requests
response = requests.get('https://api.github.com/events')
print (response)
Message:
PythonTesting/main.py", line 5, in <module>
import requests
ImportError: No module named requests
I'm a beginner in programming. Today, I was in the same problem. I spent many hours trying fix this problem. For me worked:
open prompt comand
cd (path of scripts directory in venv - my project on VisualStudio Code)
pip install requests
Then, I opened VS and put my code to go. It's work well.
Make sure you are running the code in version 2.7 as you have installed the request package for 2.7 only. If by mistake you are running the code on version 3, then that request package won't work. In that case, you need to install the requests for python3.

Categories