gpt4 book ai didi

python - "‘python’ : No such file or directory"when running Python file as executable

转载 作者:行者123 更新时间:2023-12-03 09:57:08 25 4
gpt4 key购买 nike

我已经安装了 python,并且我的当前目录中存在一个 Wifite.py 文件。
但是每当我尝试运行 Wifite2.py 文件时,我都会收到此错误:

‘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
应该进行哪些更改才能获得 ./Wifite.py在职的?
我得到的解决方法是使用:
python3 Wifite.py
但我正在寻找替代品。

最佳答案

这条信息:

/usr/bin/env: ‘python’: No such file or directory
建议 hashbang在你的脚本中看起来像这样:
#!/usr/bin/env python
由于使用 python3 显式运行脚本工作正常,听起来你在一个发行版上,默认情况下你只有 python3没有 python .正如其他答案所暗示的,您可以安装 python-is-python3 (它基本上创建了一个 python 指向 python3 的符号链接(symbolic link))。如果您不想这样做,那么只需调整脚本的 hashbang 以便 /usr/bin/env寻找 python3 :
#!/usr/bin/env python3

关于python - "‘python’ : No such file or directory"when running Python file as executable,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65934574/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com