-2

I'm trying to install psycopg2 on Python 2.6:

easy_install-2.6 psycopg2

but receive lots of compiling errors in psycopg/psycopgmodule.c But psycopg2 is installed and works fine on the same machine on Python 2.4. Any ideas?

Igor Semenov
  • 453
  • 5
  • 13
  • 1
    Can you post some of these errors? Did you try something else? pip for example? – Thanasis Petsas Mar 23 '12 at 12:08
  • psycopg/psycopgmodule.c:714: error: Б─≤c_api_objectБ─≥ undeclared (first use in this function) psycopg/psycopgmodule.c:717: error: Б─≤moduleБ─≥ undeclared (first use in this function) psycopg/psycopgmodule.c:717: error: Б─≤dictБ─≥ undeclared (first use in this function) psycopg/psycopgmodule.c:717: warning: left-hand operand of comma expression has no effect psycopg/psycopgmodule.c:727: error: expected expression before Б─≤)Б─≥ token – Igor Semenov Mar 23 '12 at 12:54
  • Please include the whole output (and make sure it includes the *first* warnings and errors you get from the compiler) in your post. You are probably missing some headerfiles or library, but it's impossible to say without seeing the actual errors. – Thomas Wouters Mar 23 '12 at 13:01
  • yes the hole output would be desirable. Can you check the first errors? Did you see something like this: Warning: /bin/sh: pg_config: command not found? What version of postgres do you use? If you use PostgreSQL Plus, try to do this: PATH=$PATH:/Library/PostgresPlus/x.x/bin/ sudo easy_install psycopg2, where x.x is the version of PostgreSQL Plus. You have to try this because PostgreSQL Plus doesn’t put its header files or libraries in a standard place.. – Thanasis Petsas Mar 23 '12 at 13:17
  • Thank you all! There were 2 problems: path to pg_config and missing python26-devel package. – Igor Semenov Mar 28 '12 at 16:36
  • I love "and stuff like that". – piro Mar 29 '12 at 20:15

1 Answers1

1
  1. Add path to pg_config to $PATH
  2. Install python26-devel
Alfred
  • 19,306
  • 58
  • 155
  • 232
Igor Semenov
  • 453
  • 5
  • 13