美文网首页
OSError: [Errno 8] Exec format e

OSError: [Errno 8] Exec format e

作者: 贪得_3440 | 来源:发表于2020-02-04 14:43 被阅读0次

解决办法出处:https://blog.csdn.net/wuguifa/article/details/85251983

同事在windows上写完的脚本,打包发来后无法运行,报以下错误:

OSError: [Errno 8] Exec format error:/usr/local/bin/python3^M

原因是windows的行分隔符CRLF在Linux无法识别

确认方式:

cat -v xxxx.py

解决方式:

cat -v oldfile.py | sed -e '1,s/\^M/ /g' > newfile.py

运行此命令生成的文件即可。

相关文章

网友评论

      本文标题:OSError: [Errno 8] Exec format e

      本文链接:https://www.haomeiwen.com/subject/dxmrxhtx.html