prody / ProDy

A Python Package for Protein Dynamics Analysis
http://prody.csb.pitt.edu
Other
437 stars 158 forks source link

module 'pyparsing' has no attribute 'operatorPrecedence' #1417

Closed somody closed 3 years ago

somody commented 3 years ago

File "prody/atomic/select.py", line 1090, in _getParser parser = pp.operatorPrecedence(expr, oplist) AttributeError: module 'pyparsing' has no attribute 'operatorPrecedence'

Upon investigation, it's because 'operatorPrecedence' is deprecated in favour of 'infixNotation'. Not sure which versions should match up, but installing ProDy installs the latest version of pyparsing, which doesn't have that function anymore.

Changing the call to infixNotation instead seems to work.

jamesmkrieger commented 3 years ago

Thanks very much for spotting this. We will make ProDy check for both options.

jamesmkrieger commented 3 years ago

I have made a fix for this, which we will merge soon. This should then work if you update your prody from github.

igorsdub commented 3 years ago

Hi @jamesmkrieger,

I have installed proDy with Conda and now I seem to heve the same issue as @somody.

Traceback (most recent call last):
  File "prody/bin/prody", line 11, in <module>
    sys.exit(prody_main())
  File "prody/lib/python3.8/site-packages/prody/apps/prody_apps/__init__.py", line 53, in prody_main
    namespace.func(namespace)
  File "prody/lib/python3.8/site-packages/prody/apps/prody_apps/prody_anm.py", line 282, in <lambda>
    subparser.set_defaults(func=lambda ns: prody_anm(ns.__dict__.pop('pdb'),
  File "prody/lib/python3.8/site-packages/prody/apps/prody_apps/prody_anm.py", line 65, in prody_anm
    select = pdb.select(selstr)
  File "prody/lib/python3.8/site-packages/prody/atomic/atomic.py", line 232, in select
    return SELECT.select(self, selstr, **kwargs)
  File "prody/lib/python3.8/site-packages/prody/atomic/select.py", line 885, in select
    indices = self.getIndices(atoms, selstr, **kwargs)
  File "prody/lib/python3.8/site-packages/prody/atomic/select.py", line 943, in getIndices
    torf = self.getBoolArray(atoms, selstr, **kwargs)
  File "prody/lib/python3.8/site-packages/prody/atomic/select.py", line 994, in getBoolArray
    parser = self._getParser(selstr)
  File "prody/lib/python3.8/site-packages/prody/atomic/select.py", line 1090, in _getParser
    parser = pp.operatorPrecedence(expr, oplist)
AttributeError: module 'pyparsing' has no attribute 'operatorPrecedence'

Can you please check it again?

Cheers

jamesmkrieger commented 3 years ago

We haven’t updated the conda version of ProDy in a while. Please use the GitHub version instead for now.

brianjimenez commented 2 years ago

Hi @jamesmkrieger , any plans for a new release of ProDy on PyPI fixing this?

jamesmkrieger commented 2 years ago

Yes, I have been thinking of this. I will ask other developers if they’re ready

jamesmkrieger commented 2 years ago

Just to update you: I have now released ProDy 2.0.1, which includes this fix.

brianjimenez commented 2 years ago

Awesome @jamesmkrieger , thanks for the new release!

jamesmkrieger commented 2 years ago

You’re welcome