I cannot execute any python programs.

Basically I installed Parrot OS 3 days ago and I tried using a lot of python programs and I still got the same issue basically when I open any programs it says that :
Traceback (most recent call last):
File “”, line 1, in
ImportError: No module named requests
and I install requests using pip over 6-7 times now and I still get the same issue I tried uninstalling all of the pythons versions and reinstalling one of them only and still get the issue.
if anyone can help me with it I would appreciate it!

Make sure you are installing for the same python your program is calling.

Which version of Python does your program target (3.x or 2.x)? For example, I have Python 2.7, 3.8 and 3.9 installed on my Parrot install.

If version 3, what is the output of

python3 --version

(I really shouldn’t have to ask these basic questions.)

You should use a shebang on line one in Linux to tell the script which version of python to use. i.e.

#!/usr/bin/env python3
#!/usr/bin/env python3.9
#!/usr/bin/env python
#!/usr/bin/env python2.7
etc.
1 Like