admin管理员组文章数量:1122832
I am having problems running my Python script from the Ubuntu terminal. When I enter ./uarttest.py
, I end up with postscript files (PS-Adobe-3.0) created by ImageMagick as the properties say when I open them with Document Viewer. The files are named like the imported python modules (import os, sys, serial...).
The shebangs I tried are #!/usr/bin/env python3
and #!/usr/bin/python3
.
The python script is executable and unix formatted.
ls uarttest.py
-rwxrwxr-x 1 adk adk 1245 Jan 6 13:26 uarttest.py
file uarttest.py
uarttest.py: Python script, ASCII text executable
which python3
/usr/bin/python3
When I run the script with python3 uarttest.py
it runs as it should without errors. I have also tried to reinstall Python 3. Does anyone know what the problem is and how to fix it?
本文标签:
版权声明:本文标题:Ubuntu Python shebang line not working, script not interpreted by Python, instead PostScript files created by ImageMagick - Stac 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736281005a1926180.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论