Jason Ching Yuk
Jason Ching Yuk

Reputation: 934

Bad interpreter: No such file or directory

I am trying to deploy my site with EB CLI. Whenever I try to run $ eb --version, it always shows the error below, even though it works on my 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

Upvotes: 1

Views: 4959

Answers (4)

Federico Caccia
Federico Caccia

Reputation: 1897

In windows, it works for me using eb.exe instead of simply eb.

Upvotes: 1

Younes El Ouarti
Younes El Ouarti

Reputation: 2354

This error is related to your terminal and the environment it runs on. You get the same error with e.g. cygwin using git bash. 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:

  • Progra~1 for "Program Files"
  • Progra~2 for "Program Files (x86)"

So my line would turn into:

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

Upvotes: 4

mdiehl13
mdiehl13

Reputation: 492

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. 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.

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.

So instead I made Visual Studio Code use cmd prompt instead of bash, using the following answer: https://stackoverflow.com/a/50527994/277601

Upvotes: 0

Bhuvan Kumar
Bhuvan Kumar

Reputation: 564

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.

Upvotes: 2

Related Questions