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?

本文标签: