0

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

shdw
  • 3
  • 2
  • 3
    The `requests` module is not part of the Python standard library. Have you installed it on your system? – Blckknght Mar 08 '19 at 20:48
  • I have installed `mingw64/mingw-w64-x86_64-python3-requests` and it still throws an error unfortunately. – shdw Mar 08 '19 at 21:00

2 Answers2

2

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
VietHTran
  • 2,233
  • 2
  • 9
  • 16
0

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
Laurent LAPORTE
  • 21,958
  • 6
  • 58
  • 103