我知道有类似的问题,但我找不到解决方案。这是我所做的。ImportError:无法导入名称Ghost
我使用pip安装了ghost模块。 site-packages/ghost文件夹有3个文件__init__.py
,ghost.py
和test.py
。
__init__.py
具有以下内容
from ghost import Ghost
from test import GhostTestCase
模块认为这种方法
from ghost import Ghost
但它引发以下错误。
File "<pyshell#3>", line 1, in <module>
from ghost import ghost
File "G:\Python33\lib\site-packages\ghost\__init__.py", line 1, in <module>
from ghost import Ghost
ImportError: cannot import name Ghost
我试着将路径添加到PYTHONPATH;它没有工作。我想不通为什么它是一个标准的module.I发生在我工作的Python 3.3
'ghost'模块是你的模块吗?名称之间可能存在冲突 – gipi 2013-04-05 16:33:59
@gipi我没有使模块,我使用python模块ghost – feminkk 2013-04-05 16:41:10