项目再Windows上没有问题,可是在Linux上运行报错OSError: [Errno 8] Exec format error:

解决方法python

OSError: [Errno 8] Exec format error: '访问 .py文件的网页的时候会出现 Exec format error的问题,
通常状况下是因为基于Unix(Linux,Mac OS)系统下的问题,办法以下
1 .chmod +x  filename  filename是要访问的文件名称,设置了之后文件具备可执行权限才能被web服务器访问
2.在程序第一行加入:
#! /usr/bin/env python  若是是python3运行的话把 python 换成 python3
相关文章
相关标签/搜索