简体   繁体   English

错误的解释器:没有这样的文件或目录

[英]Bad interpreter: No such file or directory

I am trying to deploy my site with EB CLI.我正在尝试使用 EB CLI 部署我的站点。 Whenever I try to run $ eb --version, it always shows the error below, even though it works on my CMD.每当我尝试运行 $ eb --version 时,它总是显示下面的错误,即使它在我的 CMD 上工作。 Can anyone help me with it?任何人都可以帮助我吗? Thank you.谢谢你。

     /c/Users/username/AppData/Local/Programs/Python/Python35/Scripts/eb: 
     c:\users\user: bad interpreter: No such file or directory

Try double backslash:尝试双反斜杠:

C:\\Users\\username\\AppData\\Local\\Programs\\Python\\Python35\\Scripts\\eb

I was facing the same problem in ellipse, backslash and running the code in Python IDLE solved my problem.我在椭圆、反斜杠中遇到了同样的问题,在 Python IDLE 中运行代码解决了我的问题。

This error is related to your terminal and the environment it runs on.此错误与您的终端及其运行环境有关。 You get the same error with eg cygwin using git bash.例如,使用 git bash 使用 cygwin 会遇到相同的错误。 In a script I had something like this:在脚本中,我有这样的事情:

#!/c/Program Files/some_program/executable.exe

Escaping the space with a backslash or using quotes didn't work.使用反斜杠或使用引号转义空格不起作用。

The solution is to use the DOS' short filename :解决方案是使用DOS 的短文件名

  • Progra~1 for "Program Files" “程序文件”的程序~1
  • Progra~2 for "Program Files (x86)" “程序文件(x86)”的程序~2

So my line would turn into:所以我的线路会变成:

#!/c/Progra~1/some_program/executable.exe

在 Windows 中,它适用于我使用eb.exe而不是简单的eb

This did not work for me.这对我不起作用。 I tried double-backslash.我试过双反斜杠。 It seems that the 'eb' script is using the System or User paths to call other scripts.似乎“eb”脚本正在使用系统或用户路径来调用其他脚本。 Even if I manually edit my System and User PATH variables in Windows to use quotes around each entry, I still hit the above issue.即使我在 Windows 中手动编辑系统和用户 PATH 变量以在每个条目周围使用引号,我仍然遇到上述问题。

My error:我的错误:

$ /c/Users/myname/AppData/Roaming/Python/Python37/Scripts/eb -version
  bash: /c/Users/myname/AppData/Roaming/Python/Python37/Scripts/eb: 
  c:\program: bad interpreter: No such file or directory

It seems to be an issue with EB running on Bash. EB 在 Bash 上运行似乎是一个问题。

So instead I made Visual Studio Code use cmd prompt instead of bash, using the following answer: https://stackoverflow.com/a/50527994/277601因此,我使用以下答案让 Visual Studio Code 使用 cmd 提示符而不是 bash: https : //stackoverflow.com/a/50527994/277601

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM