Python script gives `: No such file or directory`

前端 未结 4 974
渐次进展
渐次进展 2020-11-29 02:36

I have several python scripts which work just fine but one script has (as of this morning) started giving me this error if I try to run it from the bash:

4条回答
  •  天涯浪人
    2020-11-29 02:50

    I came across this problem editing my code on Windows, checking it in with git, and checking out and running it on Linux.

    My solution was: tell git to Do The Right Thing. I issued this command on the Windows box:

    git config --global core.autocrlf true
    

    Modified the files and checked them in; voila, no such problem any more.

    As discussed on the Git documentation.

提交回复
热议问题