ImportError: No module named requests: But it is installed already
Try checking your Python versions. It's quite possible that you have Requests installed in one interpreter, while Atom uses another.
Run your script directly in the command line.
Python: ModuleNotFoundError: No module named 'requests'
If "pip freeze" lists the module, then one option will be to close the idle and type the following at the command prompt/terminal.
python -m idlelib
New IDLE will start and it should be possible to import the module.
No module named requests' even if I installed requests with pip
I am not 100% sure, but the paths from which python
and which pip
may indicate that you have two versions installed. The Python version being the old one that was shipped with OS X, and another version.
I would advice you to install Python27 (or even better Python3) from brew.
You can install brew with a single command, and another one for installing Python27/3. When this is done you set the PATH
variable in your shell rc file and you should be good to go.
I have Python27 installed (via brew) and my (working environment) reports the following paths:
which python: /usr/local/bin/python
which pip: /usr/local/bin/pip
And
python --version: 2.7.15
pip --version: pip 9.0.1 from /usr/local/lib/python2.7/site-packages (python2.7)
Related Topics
Efficiently Using Multiple Numpy Slices for Random Image Cropping
Multiprocessing.Pool: When to Use Apply, Apply_Async or Map
Main() Function Doesn't Run When Running Script
How Slow Is Python's String Concatenation VS. Str.Join
Printing All Instances of a Class
Python App Does Not Print Anything When Running Detached in Docker
Determine Function Name from Within That Function (Without Using Traceback)
How to Convert Surrogate Pairs to Normal String in Python
How to Upgrade All Python Packages with Pip
Pandas Read_Csv: Low_Memory and Dtype Options
What Are the Arguments to Tkinter Variable Trace Method Callbacks
How to Start a Python File While Windows Starts
What's the Simplest Way of Detecting Keyboard Input in a Script from the Terminal