[ZODB-Dev] unable to import ZODB: class ConflictError, AttributeError

Ralf Hauenschild ralf_hauenschild at gmx.de
Thu Jun 14 08:06:19 UTC 2012


Am 14.06.2012 09:18, schrieb Marius Gedminas:
> On Wed, Jun 13, 2012 at 10:58:01PM +0200, Ralf Hauenschild wrote:
>> Am 13.06.2012 19:36, schrieb Alexandre Garel:
>>> Le 13/06/2012 18:57, Ralf Hauenschild a écrit :
>>>> Hello guys,
>>>>
>>>> i've been desperately trying to install ZODB3 via the following ways:
>>>> - easy_install ZODB3
>>>> - installation of Zope2
>>>> - manual installation of ZODB3, preceeded by installation of the
>>>> requested packages from pypi
>>>>
>>>> I'm using Ubuntu and Python 2.6.
>>>>
>>>> Whe trying to import ZODB, I'm still getting the following error:
>>>>
>>>>
>>>> python
>>>> Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41)
>>>> [GCC 4.4.3] on linux2
>>>> Type "help", "copyright", "credits" or "license" for more information.
>>>>>>> import ZODB
>>>> Traceback (most recent call last):
>>>>   File "<stdin>", line 1, in<module>
>>>>   File "/usr/local/lib/python2.6/dist-packages/ZODB3-3.10.5-py2.6-linux-x86_64.egg/ZODB/__init__.py",
>>>> line 28, in<module>
>>>>     from DB import DB, connection
>>>>   File "/usr/local/lib/python2.6/dist-packages/ZODB3-3.10.5-py2.6-linux-x86_64.egg/ZODB/DB.py",
>>>> line 28, in<module>
>>>>     from ZODB.Connection import Connection
>>>>   File "/usr/local/lib/python2.6/dist-packages/ZODB3-3.10.5-py2.6-linux-x86_64.egg/ZODB/Connection.py",
>>>> line 33, in<module>
>>>>     from ZODB.blob import Blob, rename_or_copy_blob,
>>>> remove_committed_dir
>>>>   File "/usr/local/lib/python2.6/dist-packages/ZODB3-3.10.5-py2.6-linux-x86_64.egg/ZODB/blob.py",
>>>> line 35, in<module>
>>>>     from ZODB.POSException import POSKeyError
>>>>   File "/usr/local/lib/python2.6/dist-packages/ZODB3-3.10.5-py2.6-linux-x86_64.egg/ZODB/POSException.py",
>>>> line 71, in<module>
>>>>     class ConflictError(POSError,
>>>> transaction.interfaces.TransientError):
>>>> AttributeError: 'module' object has no attribute 'TransientError'
> You need a newer version of the 'transaction' package.  Unfortunately
> the changelog at http://pypi.python.org/pypi/transaction doesn't say
> which version added TransientError, but why not get the latest one?
>
>>>> Can anybody help me, please?
>>> The problem may be  with a system wide installed version of transaction.
>>>
>>> I would say, try in a virtualenv with no site packages :
>>>
>>> $ virtualenv -p /usr/bin/python2.6 --no-site-packages myproject
>>> $ cd myproject
>>> $ . bin/activate
>>> $ pip install ZODB3
>>>
>>> Hope this helps,
>> Unfortunately, the error remains :(
> Hm..  What version of 'transaction' do you get?
>
>> Thank you, Alex, anyway.
>> The suggestest installation went without any complications:
>> ......
>> ......
>> ...
>> External_Tools/zdaemon-3.0.1/myproject/bin
>>      Installing fsdump script to /media/daten/tyan/blast-tyan16x/External_Tools/zdaemon-3.0.1/myproject/bin
>>      Installing fsrefs script to /media/daten/tyan/blast-tyan16x/External_Tools/zdaemon-3.0.1/myproject/bin
>>      Installing repozo script to /media/daten/tyan/blast-tyan16x/External_Tools/zdaemon-3.0.1/myproject/bin
>>      Installing fsoids script to /media/daten/tyan/blast-tyan16x/External_Tools/zdaemon-3.0.1/myproject/bin
>>    Running setup.py install for zope.event
>>      Skipping installation of /media/daten/tyan/blast-tyan16x/External_Tools/zdaemon-3.0.1/myproject/lib/python2.6/site-packages/zope/__init__.py
>> (namespace package)
>>      Installing /media/daten/tyan/blast-tyan16x/External_Tools/zdaemon-3.0.1/myproject/lib/python2.6/site-packages/zope.event-4.0.0-py2.6-nspkg.pth
>>    Running setup.py install for zope.interface
>>      building 'zope.interface._zope_interface_coptimizations' extension
>>      gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall
>> -Wstrict-prototypes -fPIC -I/usr/include/python2.6 -c
>> src/zope/interface/_zope_interface_coptimizations.c -o build/temp.linux-x86_64-2.6/src/zope/interface/_zope_interface_coptimizations.o
>>      gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions build/temp.linux-x86_64-2.6/src/zope/interface/_zope_interface_coptimizations.o
>> -o build/lib.linux-x86_64-2.6/zope/interface/_zope_interface_coptimizations.so
>>      Skipping installation of /media/daten/tyan/blast-tyan16x/External_Tools/zdaemon-3.0.1/myproject/lib/python2.6/site-packages/zope/__init__.py
>> (namespace package)
>>      Installing /media/daten/tyan/blast-tyan16x/External_Tools/zdaemon-3.0.1/myproject/lib/python2.6/site-packages/zope.interface-4.0.1-py2.6-nspkg.pth
>> Successfully installed transaction zc.lockfile ZConfig zdaemon ZODB3
>> zope.event zope.interface
> Hm, you should've gotten the latest one.
>
>> I still get:
>>
>> python
>> Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41)
>> [GCC 4.4.3] on linux2
>> Type "help", "copyright", "credits" or "license" for more information.
>>>>> import ZODB
>> Traceback (most recent call last):
>>    File "<stdin>", line 1, in<module>
>>    File "/usr/local/lib/python2.6/dist-packages/ZODB3-3.10.5-py2.6-linux-x86_64.egg/ZODB/__init__.py",
> You're clearly not using an isolated virtualenv if you get packages from
> /usr/loca/lib/python2.6/dist-packages!
>
> Do you have PYTHONPATH set in your environment?
>
>> line 28, in<module>
>>      from DB import DB, connection
>>    File "/usr/local/lib/python2.6/dist-packages/ZODB3-3.10.5-py2.6-linux-x86_64.egg/ZODB/DB.py",
>> line 28, in<module>
>>      from ZODB.Connection import Connection
>>    File "/usr/local/lib/python2.6/dist-packages/ZODB3-3.10.5-py2.6-linux-x86_64.egg/ZODB/Connection.py",
>> line 33, in<module>
>>      from ZODB.blob import Blob, rename_or_copy_blob, remove_committed_dir
>>    File "/usr/local/lib/python2.6/dist-packages/ZODB3-3.10.5-py2.6-linux-x86_64.egg/ZODB/blob.py",
>> line 35, in<module>
>>      from ZODB.POSException import POSKeyError
>>    File "/usr/local/lib/python2.6/dist-packages/ZODB3-3.10.5-py2.6-linux-x86_64.egg/ZODB/POSException.py",
>> line 71, in<module>
>>      class ConflictError(POSError, transaction.interfaces.TransientError):
>> AttributeError: 'module' object has no attribute 'TransientError'
> Can you do
>
>    >>>  import transaction
>    >>>  transaction.__file__
>
> ?
>
> Marius Gedminas
>
>
> _______________________________________________
> For more information about ZODB, see http://zodb.org/
>
> ZODB-Dev mailing list  -  ZODB-Dev at zope.org
> https://mail.zope.org/mailman/listinfo/zodb-dev


The

  >>>  import transaction
   >>>  transaction.__file__

resulted in (@ virtualev and globalenv):


Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
 >>> import transaction
 >>> transaction.__file__
'/usr/lib/python2.6/dist-packages/transaction/__init__.pyc'
 >>>

The following things I did in the virtualenv, like you guys had proposed:
I just tried to do "python setup.py test", which failed with the same 
import error as described above.
I therefore just reinstalled ZODB by "python setup.py install", then 
launched "python setup.py test" again.
The second time, the test has been running and printing for several minutes:

It ended with:
..........
.....
Doctest: ZODB.tests.testblob.savepoint_isolation ... ok
Doctest: ZODB.tests.testblob.secure_blob_directory ... ok
testRedo (ZODB.tests.testblob.ClientStorageSharedBlobsBlobUndoTests) ... ok
testRedoOfCreation 
(ZODB.tests.testblob.ClientStorageSharedBlobsBlobUndoTests) ... ok
testUndo (ZODB.tests.testblob.ClientStorageSharedBlobsBlobUndoTests) ... ok
testUndoAfterConsumption 
(ZODB.tests.testblob.ClientStorageSharedBlobsBlobUndoTests) ... ok
testUndoWithoutPreviousVersion 
(ZODB.tests.testblob.ClientStorageSharedBlobsBlobUndoTests) ... ok

----------------------------------------------------------------------
Ran 701 tests in 988.767s

OK

All this in the virtualenv!!!

Then, I was able to import ZODB for the first time:

(myproject)tyan at tyan-desktop:/media/daten/tyan/blast-tyan16x/External_Tools/ZODB3-3.10.5$ 
python
Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
 >>> import ZODB
 >>> quit()
(myproject)tyan at tyan-desktop:/media/daten/tyan/blast-tyan16x/External_Tools/ZODB3-3.10.5$ 





But, when I switch to globalenv (real system path) again, I still get 
the import errors:

tyan at tyan-desktop:/media/daten/tyan/blast-tyan16x/External_Tools/ZODB3-3.10.5$ 
sudo python setup.py test
running test
running egg_info
writing requirements to src/ZODB3.egg-info/requires.txt
writing src/ZODB3.egg-info/PKG-INFO
writing top-level names to src/ZODB3.egg-info/top_level.txt
writing dependency_links to src/ZODB3.egg-info/dependency_links.txt
writing entry points to src/ZODB3.egg-info/entry_points.txt
reading manifest file 'src/ZODB3.egg-info/SOURCES.txt'
writing manifest file 'src/ZODB3.egg-info/SOURCES.txt'
running build_ext
copying build/lib.linux-x86_64-2.6/BTrees/_OOBTree.so -> src/BTrees
copying build/lib.linux-x86_64-2.6/BTrees/_IOBTree.so -> src/BTrees
copying build/lib.linux-x86_64-2.6/BTrees/_OIBTree.so -> src/BTrees
copying build/lib.linux-x86_64-2.6/BTrees/_IIBTree.so -> src/BTrees
copying build/lib.linux-x86_64-2.6/BTrees/_IFBTree.so -> src/BTrees
copying build/lib.linux-x86_64-2.6/BTrees/_fsBTree.so -> src/BTrees
copying build/lib.linux-x86_64-2.6/BTrees/_LOBTree.so -> src/BTrees
copying build/lib.linux-x86_64-2.6/BTrees/_OLBTree.so -> src/BTrees
copying build/lib.linux-x86_64-2.6/BTrees/_LLBTree.so -> src/BTrees
copying build/lib.linux-x86_64-2.6/BTrees/_LFBTree.so -> src/BTrees
copying build/lib.linux-x86_64-2.6/persistent/cPersistence.so -> 
src/persistent
copying build/lib.linux-x86_64-2.6/persistent/cPickleCache.so -> 
src/persistent
copying build/lib.linux-x86_64-2.6/persistent/TimeStamp.so -> src/persistent
Traceback (most recent call last):
   File "setup.py", line 216, in <module>
     include_package_data = True,
   File "/usr/lib/python2.6/distutils/core.py", line 152, in setup
     dist.run_commands()
   File "/usr/lib/python2.6/distutils/dist.py", line 975, in run_commands
     self.run_command(cmd)
   File "/usr/lib/python2.6/distutils/dist.py", line 995, in run_command
     cmd_obj.run()
   File "/usr/lib/python2.6/dist-packages/setuptools/command/test.py", 
line 137, in run
     self.with_project_on_sys_path(self.run_tests)
   File "/usr/lib/python2.6/dist-packages/setuptools/command/test.py", 
line 117, in with_project_on_sys_path
     func()
   File "/usr/lib/python2.6/dist-packages/setuptools/command/test.py", 
line 146, in run_tests
     testLoader = loader_class()
   File "/usr/lib/python2.6/unittest.py", line 816, in __init__
     self.parseArgs(argv)
   File "/usr/lib/python2.6/unittest.py", line 843, in parseArgs
     self.createTests()
   File "/usr/lib/python2.6/unittest.py", line 849, in createTests
     self.module)
   File "/usr/lib/python2.6/unittest.py", line 613, in loadTestsFromNames
     suites = [self.loadTestsFromName(name, module) for name in names]
   File "/usr/lib/python2.6/unittest.py", line 598, in loadTestsFromName
     test = obj()
   File "setup.py", line 134, in alltests
     import ZEO.ClientStorage
   File 
"/media/daten/tyan/blast-tyan16x/External_Tools/ZODB3-3.10.5/src/ZEO/ClientStorage.py", 
line 24, in <module>
     from ZEO.cache import ClientCache
   File 
"/media/daten/tyan/blast-tyan16x/External_Tools/ZODB3-3.10.5/src/ZEO/cache.py", 
line 35, in <module>
     import ZODB.fsIndex
   File 
"/media/daten/tyan/blast-tyan16x/External_Tools/ZODB3-3.10.5/src/ZODB/__init__.py", 
line 28, in <module>
     from DB import DB, connection
   File 
"/media/daten/tyan/blast-tyan16x/External_Tools/ZODB3-3.10.5/src/ZODB/DB.py", 
line 28, in <module>
     from ZODB.Connection import Connection
   File 
"/media/daten/tyan/blast-tyan16x/External_Tools/ZODB3-3.10.5/src/ZODB/Connection.py", 
line 33, in <module>
     from ZODB.blob import Blob, rename_or_copy_blob, remove_committed_dir
   File 
"/media/daten/tyan/blast-tyan16x/External_Tools/ZODB3-3.10.5/src/ZODB/blob.py", 
line 34, in <module>
     from ZODB import utils
ImportError: cannot import name utils
tyan at tyan-desktop:/media/daten/tyan/blast-tyan16x/External_Tools/ZODB3-3.10.5$ 


:(

Any further ideas?
Python path is set in the global environment. In the virtualenv, it was 
not set, but everything worked there anyway.


Best regards,
Ralf



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.zope.org/pipermail/zodb-dev/attachments/20120614/87da47a9/attachment-0001.html>


More information about the ZODB-Dev mailing list