Comment 7 for bug 899794

Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote : Re: [Bug 899794] Re: [6.1] cannot upload company logo

On 12/16/2011 02:48 AM, Kenneth Andresen wrote:
> I have found psycopg2 requires not only libpq-dev but gcc as well...
> That is ok in development, but normally NOT acceptable at the time of
> deployment. I believe is a huge mistake to require GCC to be required on
> a web-server. I will likely not be testing this until an acceptable
> workaround exist.

You might be overreacting here ;-)

The error with missing "pg_config" during upgrade/install shows that
there is no precompiled binary available for your platform, so
pip/easy_install have to download the source version and compile it on
the spot. psycopg2 is not a pure Python lib, it contains native C code
that depends on the platform, in order to talk to the postgres native
libs. Hence the compilation step when installing from source.
This is the only reason why postgres' development tools and gcc are
neeeded on the machine. They won't be used after psycopg2 is installed,
you could even remove them.

Now if you don't like that on a production machine, why don't you
install a precompiled binary version of psycopg2 instead? Depending on
your platform, it might be readily available in your distribution
packages. On a recent Ubuntu for example:

 $ sudo apt-cache show python-psycopg2 | grep Version
 Version: 2.4.2-1
 $ # ^^ this means I can install a binary version with apt-get

Another option is to install it with easy_install on a development
machine (with the same architecture as the prod machine) and then
transfer the resulting Python egg (easy_install will build one and
install it on the dev machine) to the prod machine.
You can install an egg directly with:
 $ sudo easy_install <egg_file>

Note that none of the above is OpenERP-specific, it's merely Python
packaging/installation stuff.

Cheers,