Answer the question
In order to leave comments, you need to log in
Linux env python no module name, wtf?
I suddenly encountered such a problem: there is a python script that collects certain data, it worked perfectly, but suddenly it broke.
In the first line specified!/usr/bin/env python3
In a script there are import requests
Actually there was a ModuleNotFoundError error. If you specify !/usr/bin/python3, everything works.
What could be the problem?
Answer the question
In order to leave comments, you need to log in
In the first case, you run python specified in the path from environment variables, in the second case, you run a very specific python3 interpreter file.
In the general case, these can be two different interpreters located in different paths and using their own libraries
You probably have two installations of python3.
What does
which python3 give
?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question