[ZODB-Dev] Mysterious traceback ...

Tim Peters tim at zope.com
Sat Jan 8 02:57:45 EST 2005


[Stephen Waterbury]
>>> I just installed ZODB 3.3 (from ZODB3-3.3.tgz) on my machine (Debian
>>> Sarge, Linux bigboote 2.6.8-1-686 #1 Thu Nov 25 04:34:30 UTC 2004 i686
>>> GNU/Linux), and when I try to import ZODB I get:
>>>
>>> Python 2.3.4 (#2, Dec  3 2004, 13:53:17) [GCC 3.3.5 (Debian 1:3.3.5-2)]
>>> on linux2 Type "help", "copyright", "credits" or "license" for more
>>> information.
>>>
>>> >>> import ZODB
>>
>> ...
>>
>>>   warn("""Couldn't import the ExtensionClass-based base class
>>> Traceback (most recent call last):
>>>   File "<stdin>", line 1, in ?
>>>   File "/usr/lib/python2.3/site-packages/ZODB/__init__.py", line 46, in
?
>>>     from DB import DB
>>>   File "/usr/lib/python2.3/site-packages/ZODB/DB.py", line 25, in ?
>>>     from ZODB.Connection import Connection
>>>   File "/usr/lib/python2.3/site-packages/ZODB/Connection.py", line 36,
in
>>
>> ?
>>
>>>     from ZODB.utils import oid_repr, z64, positive_id
>>> ImportError: cannot import name positive_id
>>>
>>
>>> help help!

[Tim Peters]
>> Nobody else has reported this, so the problem must lie in something you
>> haven't told us.  For example, *exactly* what did you that got
>> summarized by "I just installed ZODB 3.3".  For example, did you have an
>> older version of ZODB installed in the same place?

[Stephan]
> Not that I could detect, unless Debian installs a ZODB package that has a
> name that does not involve the string "ZODB" in any combination of cases,
> because that's what I checked for before I installed ZODB using 'python
> setup.py install' on the version cited.

I don't suppose you saved the output from running setup.py?

> BTW, how come there isn't a Debian ZODB package that I can find by this
> method:
>
> $ wajig search zodb
> zope-btreefolder2 - Zope folder that can efficiently contain many objects
> zope-extfile - Stores large files outside Zope
> database zope-exuserfolder - XUF -- user authentication, properties and
>                                     sessions
> zope-testcase - unit testing framework and test case for Zope
> zope-zpatterns - Database Independence and Framework Integration for Zope

Someone else will have to address this (sorry, I don't know anything about
Debian).

> None of these look like they should contain ZODB either.  Do they?

Ditto.

>> If you simply look inside ZODB3-3.3.tgz, you'll quickly see that
>> utils.py does indeed define a positive_id() function, so whatever it is
>> that you did, you're not actually importing the ZODB.utils from the
>> tarball.

> Okay, I'll take your word for it (I just solved my problem by downloading
> 3.1.5 and I don't feel like downloading 3.3 again just to look for
> something that you know is there).

3.1.5 is way behind the times.  If you don't want to use 3.3, 3.2.4 is the
current stable ZODB release, shipped with the current stable release of Zope
(2.7.3).

> BTW, what should I do if I'm installing most Python packages using
> apt-get and then I come to ZODB which doesn't appear to have been
> installed and then I install it and get this error? Should I infer that
> I've got another version installed, and if so how do I determine that and
> how do I get rid of it?  (Sorry, but I do get pissed off about all the
> pollution of site-packages that ZODB traditionally does.)  What's the
> recommended way of clearing out a previously installed version that
> probably was installed from a Debian package but I don't know which one,
> and why the heck is it so hard to determine which one if indeed it was
> installed in a Debian package (which didn't have "ZODB" in its name in
> any form)?

Can't answer any Debian questions.  Regardless of platform, you can
determine which ZODB (if any) you already have installed by doing:

    import ZODB
    print ZODB.__version__

As I said last time, nobody else has reported your symptom, so if you don't
track down the cause, it's unlikely that anyone else can tell you what went
wrong.

I personally wish ZODB didn't add so many names to site-packages either.
There's some kind of Official Story that the distinct packages could be used
independently by other projects, although I don't know of any instance of
that occurring, and doubt I ever will.  So it goes.

> But I do also appreciate your help, Tim.  Thanks!  :

What help <0.9 wink>?



More information about the ZODB-Dev mailing list