Python导入诅咒时出错-不确定原因
所以我确实安装了诅咒,我用dpkg检查过了。 现在,当我尝试导入它时,会发生这种情况Python导入诅咒时出错-不确定原因,python,curses,Python,Curses,所以我确实安装了诅咒,我用dpkg检查过了。 现在,当我尝试导入它时,会发生这种情况 Python 2.7.3 (default, Jan 13 2013, 11:20:46) [GCC 4.6.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import curses Traceback (most recent call last): File
Python 2.7.3 (default, Jan 13 2013, 11:20:46)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import curses
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "curses.py", line 3, in <module>
myscreen = curses.initscr()
AttributeError: 'module' object has no attribute 'initscr'
自从我试过之后,这种情况就发生了。有人有主意了吗?回溯(最近一次通话最后一次):
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "curses.py", line 3, in <module>
文件“”,第1行,在
文件“curses.py”,第3行,在
似乎您将自己的文件命名为curses.py,
Python首先查找当前目录,因此不能与库同名。在您的工作目录或PYTHONPATH上是否有自己的名为
curses.py
的文件?我的天。。有人请用棍子打我!是的,的确如此。@Jrc:砰!现在不要再这样做了。:-)(但公平地说,我们都去过。)这是回应我床上召唤的信号!谢谢大家,为这个愚蠢的错误感到抱歉!
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "curses.py", line 3, in <module>