如前所述,错误信息
$ Python makeReadingsFile.py eichstaett.net.xml test.readings.xml
Python: can't open file 'makeReadingsFile.py': [Errno 2] No such file or directory
发生,因为有你在哪里,告诉它寻找一个没有这样的文件。你的第二个命令看起来我的眼睛就像第一个命令:
Python makeReadingsFile.py eichstaett.net.xml test.readings.xml
Traceback (most recent call last):
File "makeReadingsFile.py", line 75, in <module>
import argparse
ImportError: No module named argparse
,你说这是使用完整的地址路径,但由于给定的路径是一样的我想你一定是说像“当你切换到正确的目录“。无论如何,这里的错误信息可能是由于您使用的是Python 2.6或之前的版本:argparse模块仅在Python 2.7中引入。
来源
2012-06-25 12:36:26
DSM
这就是说,在你所在的目录下没有makeReadingsFile.py这样的文件 – matcheek
我在这里存在这个文件的路径。尽管当我测试命令中的完整地址时,会发生以下错误:Python makeReadingsFile.py eichstaett.net.xml test.readings.xml 回溯(最近调用最后一次): 文件“makeReadingsFile.py”,第75行, import argparse ImportError:没有名为argparse的模块 –
'ls | grep .py'? –