Cygwin使用python提供错误

时间:2012-06-25 12:08:11

标签: python cygwin

我想执行下面的命令,但cygwin给出了错误。 请帮帮我。

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

1 个答案:

答案 0 :(得分:1)

如上所述,错误消息

$ 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中引入。

相关问题