ImportError: No module named psycopg2.pool after Installation

1,333 views
Skip to first unread message

jomeyy

unread,
Jul 26, 2011, 1:16:34 PM7/26/11
to tryton
Hello,

I installed Tryton and Trytond with Python EasyInstall. After that I
extracted the pythond.conf and copied it to /etc/ and configured it.

But when I try to start I got the following message:


$ /usr/local/bin/trytond
[Tue Jul 26 19:09:27 2011] INFO:server:using /etc/trytond.conf as
configuration file
[Tue Jul 26 19:09:27 2011] INFO:server:initialising distributed
objects services
Traceback (most recent call last):
File "/usr/local/bin/trytond", line 5, in <module>
pkg_resources.run_script('trytond==2.0.0', 'trytond')
File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 461,
in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 1194,
in run_script
execfile(script_filename, namespace, namespace)
File "/usr/local/lib/python2.6/dist-packages/trytond-2.0.0-py2.6.egg/
EGG-INFO/scripts/trytond", line 30, in <module>
trytond.server.TrytonServer().run()
File "/usr/local/lib/python2.6/dist-packages/trytond-2.0.0-py2.6.egg/
trytond/server.py", line 74, in run
from trytond.backend import Database
File "/usr/local/lib/python2.6/dist-packages/trytond-2.0.0-py2.6.egg/
trytond/backend/__init__.py", line 10, in <module>
from postgresql import *
File "/usr/local/lib/python2.6/dist-packages/trytond-2.0.0-py2.6.egg/
trytond/backend/postgresql/__init__.py", line 4, in <module>
from database import *
File "/usr/local/lib/python2.6/dist-packages/trytond-2.0.0-py2.6.egg/
trytond/backend/postgresql/database.py", line 7, in <module>
from psycopg2.pool import ThreadedConnectionPool
ImportError: No module named psycopg2.pool

Sharoon Thomas

unread,
Jul 26, 2011, 4:06:55 PM7/26/11
to try...@googlegroups.com

On Jul 26, 2011, at 1:16 PM, jomeyy wrote:

>
> ImportError: No module named psycopg2.pool
>

This means that psycopg2 (the python driver for postgresql) is not installed. trytond installation does not install a database driver because triton supports three database backends (and in future may be more).

To install psycopg2 you can use

`easy_install psycopg2`

or use pip (which is preferred)

`pip install psycopg2`

If you are on ubuntu it might be easier to install from aptitude source as compiling psycopg2 requires its C dependency libpq which is all taken care of the package in ubuntu. The command for the same is

`sudo apt-get install python-psycopg2`

Thanks,

Sharoon Thomas

Reply all
Reply to author
Forward
0 new messages