python:使程序executab后发生导入错误

2024-10-01 07:48:59 发布

您现在位置:Python中文网/ 问答频道 /正文

当我以python JIRAClient.py的身份运行程序时,一切正常。但是在我通过添加#!/usr/bin/env python并赋予它执行权限使程序可执行之后,当我试图以./JIRAClient.py的身份运行程序时,我会遇到一些错误

from: can't read /var/mail/jira.client
Version: ImageMagick 6.8.6-3 2013-07-06 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2013 ImageMagick Studio LLC
Features: DPC Modules
Delegates: bzlib freetype jng jpeg png xml zlib

Usage: import [options ...] [ file ]
Image Settings:
......
Image Operators:
......
Miscellaneous Options:
......
By default, 'file' is written in the MIFF image format.  To
specify a particular image format, precede the filename with an image
format name and a colon (i.e. ps:image) or specify the image type as
the filename suffix (i.e. image.ps).  Specify 'file' as '-' for
standard input or output.
import: delegate library support not built-in `' (X11) @ error/import.c/ImportImageCommand/1298.
./JIRAClient.py: line 4: config_ini: command not found
./JIRAClient.py: line 5: syntax error near unexpected token `('
./JIRAClient.py: line 5: `config = ConfigParser.ConfigParser()'

这个错误是什么意思?这两种运行程序的方法有什么区别?在

产生错误的代码行如下:

^{pr2}$

Tags: theinpyimageimport程序format错误
1条回答
网友
1楼 · 发布于 2024-10-01 07:48:59

您的程序正试图像bash脚本一样运行,因此您的#!/usr/bin/env python似乎没有任何效果。请确保这一行位于程序的第一行的顶部,#之前没有字符

相关问题 更多 >