shdw
shdw

Reputation: 3

Python 3.7 ModuleNotFound

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

Answers (2)

VietHTran
VietHTran

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

Laurent LAPORTE
Laurent LAPORTE

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

Related Questions