AttributeError:模块对象没有属性'download'

时间:2018-01-01 15:06:58

标签: python download nltk attributeerror

我收到此AttributeError

Traceback (most recent call last):
  File "newyear1.py", line 1, in <module>
    import nltk
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/nltk/__init__.py", line 89, in <module>
    from nltk.internals import config_java
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/nltk/internals.py", line 31, in <module>
    from nltk import compat
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/nltk/compat.py", line 65, in <module>
    import csv
  File "/Users/JK/Documents/csv.py", line 2, in <module>
    """
AttributeError: 'module' object has no attribute 'download'

我假设这个错误是因为csv.py文件仍然在缓存中的某个地方?新文件名为newyear1.py。但我不明白这个错误,特别是如果我尝试更新nltk,它会告诉我它是最新的。

1 个答案:

答案 0 :(得分:0)

这是另一个新手时刻。我正在使用的文件格式错误。我通过在新目录中创建一个新文件来解决这个问题。