Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Issue with making python program executable

Tags:

python

I'm trying to make a program so that I can run it through the command line with the following format:

./myProgram

I made it executable and put #!/usr/bin/env python in the header, but it's giving me the following error.

env: python\r: No such file or directory

However, when I run "python myProgram", it runs fine. Can someone tell me what I'm doing wrong?

like image 318
Sam Avatar asked Nov 28 '22 08:11

Sam


1 Answers

Your line endings are wrong. Use dos2unix to fix them.

like image 106
Ignacio Vazquez-Abrams Avatar answered Dec 10 '22 10:12

Ignacio Vazquez-Abrams