关于安装trac0.93的问题

关于安装trac0.93的问题

*安装了trac0.93
*安装了sqlite2.8.17
*安装了pysqlite1.0.1
等等基础模块和依赖包
但是在trac-admin初始化时出错了,在google邮件列表发现有人也遇到这个错误,但没有解决的下文。
希望懂python和trac的朋友帮帮忙,谢谢!
出错信息如下:

[root@localhost trac-0.9.3]# trac-admin /usr/src/yougedi/trac_project3 initenv
Creating a new Trac environment at /usr/src/yougedi/trac_project3

Trac will first ask a few questions about your environment
in order to initalize and prepare the project database.

Please enter the name of your project.
This name will be used in page titles and descriptions.

Project Name [My Project]>

Please specify the connection string for the database to use.
By default, a local SQLite database is created in the environment
directory. It is also possible to use an already existing
PostgreSQL database (check the Trac documentation for the exact
connection string syntax).

Database connection string [sqlite:db/trac.db]>

Please specify the absolute path to the project Subversion repository.
Repository must be local, and trac-admin requires read+write
permission to initialize the Trac database.

Path to repository [/var/svn/test]> /usr/src/yougedi/engine

Please enter location of Trac page templates.
Default is the location of the site-wide templates installed with Trac.

Templates directory [/usr/share/trac/templates]>

Creating and Initializing Project
Failed to create environment. global name 'sqlite' is not defined
Traceback (most recent call last):
File "/usr/lib/python2.3/site-packages/trac/scripts/admin.py", line 141, in env_create
self.__env = Environment(self.envname, create=True, db_str=db_str)
File "/usr/lib/python2.3/site-packages/trac/env.py", line 79, in __init__
self.create(db_str)
File "/usr/lib/python2.3/site-packages/trac/env.py", line 197, in create
db.init_db(self.path, db_str)
File "/usr/lib/python2.3/site-packages/trac/db.py", line 442, in init_db
cls.init_db(**args)
File "/usr/lib/python2.3/site-packages/trac/db.py", line 321, in init_db
cnx = sqlite.connect(path, timeout=int(params.get('timeout', 10000)))
NameError: global name 'sqlite' is not defined
Failed to initialize environment. 1
Traceback (most recent call last):
File "/usr/lib/python2.3/site-packages/trac/scripts/admin.py", line 596, in do_initenv
self.env_create(db_str)
File "/usr/lib/python2.3/site-packages/trac/scripts/admin.py", line 146, in env_create
sys.exit(1)


为什么说sqlite没定义?我已经安装了sqlite2.8.17,pysqlite1.0.1
我看了一下,它需要pysqlite2,不是pysqlite。这是两个不同的包。


QUOTE:
原帖由 limodou 于 2006-2-3 21:36 发表
我看了一下,它需要pysqlite2,不是pysqlite。这是两个不同的包。

我安装的pysqlite是安装文档中指向的站点。估计没按错包。
下载的包为http://initd.org/pub/software/py ... sqlite-1.0.1.tar.gz

并且文档中有说:
http://projects.edgewall.com/trac/wiki/TracInstall
For SQLite

    * SQLite, version 2.8.x or 3.x
    * PySQLite
          o version 1.0.x (for SQLite 2.8.x) #我安装的pysqlite是1.0.x版本,sqlite2.8.17
          o version 1.1.x or 2.x (for SQLite 3.x)

可是还是找不到'sqlite'的定义。不太懂python.

不过我查了那块出错的代码,它要的的确是pysqlite2呀。

[Copy to clipboard] [ - ]
CODE:
    import pysqlite2.dbapi2 as sqlite

因此我还是建议你安装pysqlite2试一下。而且sqlite只是trac使用的,对于pysqlite包它不再需要独立安装sqlite。当然如果你希望使用使用行的话可能还是需要的。
pysqlite2 => http://initd.org/pub/software/py ... sqlite-2.1.2.tar.gz
是这个吧。
我重新安装了sqlite3.3.3,pysqlite-2.1.2仍然有相同的问题。我在找找问题!