I have installed python and I have a file Wifite.py that exists in my current directory.
But whenever I try to run the Wifite2.py file I receive this error:
‘python’: No such file or directory
jarvus@jarvus:~/wifite2$ ls
bin PMKID.md setup.py wordlist
Dockerfile README.md tests wordlist-
EVILTWIN.md reaver-wps-fork-t6x TODO.md
LICENSE runtests.sh wifite
MANIFEST.in setup.cfg Wifite.py
jarvus@jarvus:~/wifite2$ ./Wifite.py
/usr/bin/env: ‘python’: No such file or directory
What changes should be made to get ./Wifite.py working?
The workaround I got is using:
python3 Wifite.py
But I'm looking for alternatives.
4 Answers 4
This message:
/usr/bin/env: ‘python’: No such file or directory
suggests that the hashbang in your script looks like this:
#!/usr/bin/env python
Since running the script explicitly with python3 worked OK, it sounds like you're on a distro where by default you only have python3 and no python. As other answers suggest, you may install python-is-python3 (which basically creates a python symlink pointing to python3). If you don't wish to do that, then just adjust the script's hashbang so that /usr/bin/env looks for python3:
#!/usr/bin/env python3
3 Comments
ln -s /usr/bin/python3 /usr/local/bin/python Use thisSeems you don't have python2 installed but only python3 but it is not registered as plain python.
Try
which python
which python2
which python3
If only the last command runs without error you can try to link python3 to python with
sudo apt-get install python-is-python3
1 Comment
python3, then use python3 (in the shebang, when running scripts, ex). The OS may rely on python being an actual Python 2.Try running python3 Wifite2.py from the directory where the file exists.
4 Comments
python3 Wifite2.py, you could vim Wifite2.py etc. If you want to run the script, you must specify it./bin/sh.Use shebangs! In the first line of your script write the python interpretor path.
#! /usr/bin/python
Then chmod +x your file on shell. That will make it executable. And you can directly run it.
2 Comments
/usr/local/bin/python3 (or whatever is the output of which python3) if that is what is available on the system.
python Wifite2.pypython3 Wifinite2.py, it seems that you have some misconfiguration between python2 and python3envcan't find it in your defaultPATH. If you installed it throughsudo apt install python3or similar, that shouldn't be happening.sudo apt-get install python-is-python3