python 3.x - PyParsing not importing Word or alphas -
os x 10.9.5, python 3.4, pyparsing 2.0.3, pycharm 4.0 ce
i installed pyparsing using easy_install, , see in pycharm project interpreter panel in there rest of python 3.4 packages.
i tried running following "hello world!" script pyparsing wiki:
from pyparsing import word, alphas greet = word( alphas ) + "," + word( alphas ) + "!" hello = "hello, world!" print (hello, "->", greet.parsestring( hello ))
i following errors:
file "/users/..../pyparsing.py", line 1, in <module> pyparsing import word, alphas importerror: cannot import name 'word'
the pycharm code window message says, "this inspection detects names should resolve don't. due dynamic dispatch , duck typing, possible in limited useful number of cases. top-level , class-level items supported better instance items."
i have tried googling similar situations , solutions, have hit impasse.
you haven't chance called program file "pyparsing.py" have you? if confuse python (it try import word itself. try changing name inoffensive temp1.py
edit avoid using names files , variable might confuse both python interpreter , you.
Comments
Post a Comment