When I am trying to import the pubnub
library, I am getting the following error. I am not able to understand the cause of the problem. Please help.
>>> import pubnub
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import pubnub
File "C:\Python34\lib\site-packages\pubnub.py", line 152, in <module>
from twisted.internet import reactor
File "C:\Python34\lib\site-packages\twisted\internet\reactor.py", line 38, in <module>
from twisted.internet import default
File "C:\Python34\lib\site-packages\twisted\internet\default.py", line 56, in <module>
install = _getInstallFunction(platform)
File "C:\Python34\lib\site-packages\twisted\internet\default.py", line 50, in _getInstallFunction
from twisted.internet.selectreactor import install
File "C:\Python34\lib\site-packages\twisted\internet\selectreactor.py", line 18, in <module>
from twisted.internet import posixbase
File "C:\Python34\lib\site-packages\twisted\internet\posixbase.py", line 18, in <module>
from twisted.internet import error, udp, tcp
File "C:\Python34\lib\site-packages\twisted\internet\udp.py", line 53, in <module>
from twisted.internet import base, defer, address
File "C:\Python34\lib\site-packages\twisted\internet\base.py", line 23, in <module>
from twisted.internet import fdesc, main, error, abstract, defer, threads
File "C:\Python34\lib\site-packages\twisted\internet\defer.py", line 29, in <module>
from twisted.python import lockfile, failure
File "C:\Python34\lib\site-packages\twisted\python\lockfile.py", line 52, in <module>
_open = file
NameError: name 'file' is not defined
What can I do to remove this error? This error appears even when I use commands like from pubnub import Pubnub
.
EDIT: The error above has been solved but now a new error has occured. from pubnub import Pubnub
was working fine in the Python shell but when I run it from my file I get an error: ImportError: cannot import name 'Pubnub'
.
Thanks.