python - How to install psycopg2-2.6 with python2.6 -


my linux server: 2.6.18 rhel5

gcc version: gcc (gcc) 4.1.2 20080704 (red hat 4.1.2-51)

installed rpm packages:

python26-2.6.5-4.el5 python26-devel-2.6.5-4.el5 postgresql-devel-8.1.23-1 postgresql-libs-8.1.23-1 postgresql-devel-8.1.23-1 postgresql-8.1.23-1 

when run "python2.6 setup.py install", error message is:

gcc -pthread -shared build/temp.linux-x86_64-2.6/psycopg/psycopgmodule.o build/temp.linux-x86_64-2.6/psycopg/green.o build/temp.linux-x86_64-2.6/psycopg/pqpath.o build/temp.linux-x86_64-2.6/psycopg/utils.o build/temp.linux-x86_64-2.6/psycopg/bytes_format.o build/temp.linux-x86_64-2.6/psycopg/connection_int.o build/temp.linux-x86_64-2.6/psycopg/connection_type.o build/temp.linux-x86_64-2.6/psycopg/cursor_int.o build/temp.linux-x86_64-2.6/psycopg/cursor_type.o build/temp.linux-x86_64-2.6/psycopg/diagnostics_type.o build/temp.linux-x86_64-2.6/psycopg/error_type.o build/temp.linux-x86_64-2.6/psycopg/lobject_int.o build/temp.linux-x86_64-2.6/psycopg/lobject_type.o build/temp.linux-x86_64-2.6/psycopg/notify_type.o build/temp.linux-x86_64-2.6/psycopg/xid_type.o build/temp.linux-x86_64-2.6/psycopg/adapter_asis.o build/temp.linux-x86_64-2.6/psycopg/adapter_binary.o build/temp.linux-x86_64-2.6/psycopg/adapter_datetime.o build/temp.linux-x86_64-2.6/psycopg/adapter_list.o build/temp.linux-x86_64-2.6/psycopg/adapter_pboolean.o build/temp.linux-x86_64-2.6/psycopg/adapter_pdecimal.o build/temp.linux-x86_64-2.6/psycopg/adapter_pint.o build/temp.linux-x86_64-2.6/psycopg/adapter_pfloat.o build/temp.linux-x86_64-2.6/psycopg/adapter_qstring.o build/temp.linux-x86_64-2.6/psycopg/microprotocols.o build/temp.linux-x86_64-2.6/psycopg/microprotocols_proto.o build/temp.linux-x86_64-2.6/psycopg/typecast.o -l. -l/usr/lib64 -lpython2.6 -lpq -o build/lib.linux-x86_64-2.6/psycopg2/_psycopg.so /usr/bin/ld: build/temp.linux-x86_64-2.6/psycopg/psycopgmodule.o: relocation r_x86_64_pc32 against `lobjecttype' can not used when making shared object; recompile -fpic /usr/bin/ld: final link failed: bad value collect2: ld return 1 error: command 'gcc' failed exit status 1 

when use "gcc -fpic", result still same.

i know asked long time ago, came across same problem described (though on centos system instead of red hat).

i not sure if help, problem version of libpq (installed postgres) "too old". solution worked me install version 2.5 of psycopg2. version enough needs.

i found idea here: https://github.com/psycopg/psycopg2/issues/305

i used version 2.5, perhaps newer version work well. found source code here: http://initd.org/psycopg/tarballs/psycopg-2-5/


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -