且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

“Bad Interpreter: No such file or directory"的原因是什么?

更新时间:2023-02-18 19:23:47

你有一个脚本 /home/ubuntu/env/bin/pip 并且脚本有 shebang #!/home/ubuntu/env/bin/python 但文件是不存在或不可执行.

You have a script /home/ubuntu/env/bin/pip and the script has shebang #!/home/ubuntu/env/bin/python but the file is either absent or is not executable.

检查文件 /home/ubuntu/env/bin/python 是否存在.检查它是否可以由当前用户执行(只需从命令行运行它).如果没有——你需要找到一个可以运行的可执行文件(例如,它可能是 /home/ubuntu/env/bin/python3),编辑 /home/ubuntu/的第一行env/bin/pip 修复shebang.

Check if the file /home/ubuntu/env/bin/python exist. Check if it can be executed by the current user (just run it from the command line). If not — you need to find out a working executable (for example, it could be /home/ubuntu/env/bin/python3), edit the first line of /home/ubuntu/env/bin/pip to fix the shebang.