[Distutils] python setup.py test not working on Linux

Gerhard Häring gh at ghaering.de
Fri Jan 20 01:35:18 CET 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Phillip J. Eby wrote:
> At 11:16 PM 01/19/2006 +0100, Gerhard Häring wrote:
> 
>> AttributeError: 'module' object has no attribute 'test'
> 
> This is probably an indication that the '.test' package was not
> importable for some reason.
> 
> Try this:
> 
> python setup.py develop
> python -c "import pysqlite2.test"

You were right!

gerhard at lara:~/src/svn/pysqlite/trunk$ python -c "import pysqlite2.test"
Traceback (most recent call last):
  File "<string>", line 1, in ?
  File
"/home/gerhard/src/svn/pysqlite/trunk/pysqlite2/test/__init__.py", line
25, in ?
    from pysqlite2.test import dbapi, types, userfunctions, factory,
transactions
  File "/home/gerhard/src/svn/pysqlite/trunk/pysqlite2/test/dbapi.py",
line 26, in ?
    import pysqlite2.dbapi2 as sqlite
  File "lib/dbapi2.py", line 32, in ?
    from pysqlite2._sqlite import *
ImportError: pysqlite2/_sqlite.so: undefined symbol:
sqlite3_transfer_bindings

> and see what happens.  The unittest package is rather notorious for not
> giving good error messages in the case of a failed import.  It should
> really reraise the ImportError when it is unable to find an attribute.

I forgot one step I usually always do when I get the above error message ...
gerhard at lara:~/src/svn/pysqlite/trunk$ export
LD_LIBRARY_PATH=/usr/local/lib/
gerhard at lara:~/src/svn/pysqlite/trunk$ python setup.py test -q
running test
running egg_info
writing requirements to pysqlite.egg-info/requires.txt
writing pysqlite.egg-info/PKG-INFO
writing top-level names to pysqlite.egg-info/top_level.txt
warning: manifest_maker: standard file not found: should have one of
README, README.txt
reading manifest template 'MANIFEST.in'
writing manifest file 'pysqlite.egg-info/SOURCES.txt'
running build_ext
copying build/lib.linux-i686-2.4/pysqlite2/_sqlite.so -> lib
.......................................................................................................................................................
- ----------------------------------------------------------------------
Ran 151 tests in 1.671s

OK

Now it works perfectly! Thanks.

- -- Gerhard
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD4DBQFD0DBGdIO4ozGCH14RAhwuAJ43ooK9MH7pTCiYVE1M9Vtbx0ZkywCYt597
S2lVHfrT3RpPtN0Uec44eQ==
=muGK
-----END PGP SIGNATURE-----


More information about the Distutils-SIG mailing list