MemoizedSlots removed from util?

Issue #3595 closed
jomaroceguedag created an issue

I got the following error attempting to load sqlalchemy. More precisely, this occurs attempting to run buildbot (http://buildbot.net/index.html), which attempts to load sqlalchemy:

AttributeError: 'module' object has no attribute 'MemoizedSlots'

sqlalchemy version: 1.0.9 OS: Ubuntu 14.04 LTS Python dist: Anaconda 2

The following is the complete trace:

Traceback (most recent call last): File "/home/omar/anaconda2/bin/buildbot", line 3, in <module> from buildbot.scripts import runner File "/home/omar/anaconda2/lib/python2.7/site-packages/buildbot/scripts/runner.py", line 24, in <module> import sqlalchemy as sa File "/home/omar/anaconda2/lib/python2.7/site-packages/sqlalchemy/init.py", line 52, in <module> from sqlalchemy.types import ( File "/home/omar/anaconda2/lib/python2.7/site-packages/sqlalchemy/types.py", line 27, in <module> from sqlalchemy import exc, schema File "/home/omar/anaconda2/lib/python2.7/site-packages/sqlalchemy/schema.py", line 33, in <module> from sqlalchemy import event, events File "/home/omar/anaconda2/lib/python2.7/site-packages/sqlalchemy/event/init.py", line 8, in <module> from .api import CANCEL, NO_RETVAL, listen, listens_for, remove, contains File "/home/omar/anaconda2/lib/python2.7/site-packages/sqlalchemy/event/api.py", line 14, in <module> from .base import _registrars File "/home/omar/anaconda2/lib/python2.7/site-packages/sqlalchemy/event/base.py", line 23, in <module> from .attr import _JoinedListener, \ File "/home/omar/anaconda2/lib/python2.7/site-packages/sqlalchemy/event/attr.py", line 43, in <module> class RefCollection(util.MemoizedSlots): AttributeError: 'module' object has no attribute 'MemoizedSlots'

Comments (5)

  1. Mike Bayer repo owner

    it hasn't been removed, indeed the MemoizedSlots feature was only added in 1.0. Which is why your issue is likely that your buildbot got files from an old branch onto it at some point and is potentially caching old .pyc files. I'd blow away your buildbot env and start clean.

  2. Mike Bayer repo owner

    for debugging, just call up a Python interpreter using the same as that of your buildbot and test:

    #!
    
    
    [ sqlalchemy]$ python
    Python 2.7.10 (default, Sep  8 2015, 17:20:17) 
    [GCC 5.1.1 20150618 (Red Hat 5.1.1-4)] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> from sqlalchemy import util
    >>> util.MemoizedSlots
    <class 'sqlalchemy.util.langhelpers.MemoizedSlots'>
    
    [sqlalchemy]$ python
    Python 2.7.10 (default, Sep  8 2015, 17:20:17) 
    [GCC 5.1.1 20150618 (Red Hat 5.1.1-4)] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import sqlalchemy as sa
    >>> 
    
  3. jomaroceguedag reporter

    Thank you Mike!, I just reinstalled everything using standard tools (instead of anaconda) and everything works correctly. Sorry for the false alarm, and thank you very much for your help!

  4. Log in to comment