cannot import name Word

Issue #552 resolved
Former user created an issue

Calling the summary page of a (new created) repo leads to an internal server error. The log file says:

cannot import name Word

I created a plain new installation/configuration of rhode code following the documentation (I used pip for installing rhodecode 1.4.0). And it doesn't matter whether the repo belongs to a repo group. It also makes no difference whether I'm trying to access the web page as admin or user.

Please see attached logfile for full trace.

Comments (9)

  1. Marcin Kuzminski repo owner

    wow that is odd,It comes from celery dependencies. what python version are you using ? try installing latest version of pyparsing library

  2. Thorsten Hirsch

    It's python 2.7.3 which comes with Ubuntu 12.04. Unfortunately pyparsing seems to be the latest version already:

    pyparsing - Python parsing module INSTALLED: 1.5.6 (latest)

    edit: But wait, celery was version 2.x only. After upgrading I get a dependency error, so I'm trying to install everything again...

  3. Marcin Kuzminski repo owner
    In [39]: import pyparsing
    
    In [40]: pyparsing.__version__
    Out[40]: '1.5.6'
    
    In [41]: from pyparsing import (Word, Literal, ZeroOrMore)
    
    In [42]: Word
    Out[42]: pyparsing.Word
    
    

    Works on my python2.7 can you try this out in python prompt ?

  4. Thorsten Hirsch

    Doesn't work. Even after re-installing the package (sudo pip install -I pyparsing), I get an error:

    >>> import pyparsing
    >>> pyparsing.__version__
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    AttributeError: 'module' object has no attribute '__version__'
    
  5. Marcin Kuzminski repo owner

    There must be something in your python environment.

    where does the

    pyparsing.__file__
    

    point to for me it's

    In [46]: pyparsing.__file__
    Out[46]: '/usr/lib64/python2.7/site-packages/pyparsing.pyc'
    
    
  6. Thorsten Hirsch

    Here it's:

    >>> import pyparsing
    >>> pyparsing.__file__
    '/usr/local/lib/python2.7/dist-packages/pyparsing.py'
    

    So it's the pip version. There's also a package in the Ubuntu repository - let me try that one...

    Ouch. Now pyparsing.file still points to the one I deleted (from pip). How can I rebuild python's lib database ...or egg database ...or what's-it-called?

    P.S.: celery 3.x did not work, because rhode code also has version range 2.2.0 up to 2.3.0 in its dependency attributes for celery. So I'm back at celery 2.2.x.

  7. Thorsten Hirsch

    Here's a solution: I installed both: pyparsing 1.5.2 from Ubuntu and pyparsing 1.5.6 with pip. Python's version information tells me that I'm using 1.5.6. And the RhodeCode error is gone now.

    I don't know why pyparsing 1.5.6 from pip doesn't work without 1.5.2 from Ubuntu. Maybe it's because of the order I installed/uninstalled modules yesterday: first I installed 1.5.6 (pip) while 1.5.2 (dpkg) was already there. Then I saw that I had 2 versions, so I uninstalled 1.5.2 (dpkg).

    Anyway, thank you very much Marcin!

  8. Log in to comment