Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/amazon-s3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python导入诅咒时出错-不确定原因_Python_Curses - Fatal编程技术网

Python导入诅咒时出错-不确定原因

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

所以我确实安装了诅咒,我用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 "<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>