I know there are similar questions, but I could not find a solution for this one. Here is what I have done.
I installed the ghost module using pip. The site-packages/ghost folder has 3 files __init__.py
, ghost.py
and test.py
.
__init__.py
has the following content
from ghost import Ghost
from test import GhostTestCase
module suggests the method
from ghost import Ghost
But it throws the following error.
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
I tried adding the path to PYTHONPATH; it didn't work. I can't figure out why it is happening with a standard module.I am working in python 3.3
With Python 3, try changing that line in __init__.py
to
from .ghost import Ghost
to do a package-relative import. If that works, it's a bug in the module and you should report it.
What was you pip command line? Should be pip install Ghost.py
and not pip install ghost
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With