Reputation: 3
I'm using MSYS2 but without pip (SSL error), and when I try to run
python vin.py
It throws me this error:
Traceback (most recent call last):
File "vin.py", line 1, in <module>
import requests
ModuleNotFoundError: No module named 'requests'
What can I do? Thanks in advance
Upvotes: 0
Views: 750
Reputation: 2318
I think it is because you installed the requests
module for Python 3 while you are running Python 2.
To specifically install the package for Python 2, try entering this command:
pip2 install requests
or
python -m pip install requests
If you want to run the script with Python 3 instead, simply change python
to python3
, so:
python3 vin.py
Upvotes: 2
Reputation: 22952
It is better to use a virtualenv
:
First create a virtualenv for your project and activate it:
python -m venv my_project
source my_project/bin/activate
Then install Requests
:
pip install requests
To test: run python and import requests
>>> import requests
Upvotes: 1