Problem installing pyscopg2 on mac os x

I downloaded the latest pyscopg2 assembly and tried to build and install it using the provided instructions. However, I always get an error that "w" is not declared. Does anyone have any experience with this?

+3
source share
3 answers

This is an error that occurs when the build tools cannot find your Postgresql libraries. This means one of three things:

  • You do not have postgresql installed on your system. If so, download and create postgres, or download the pre-created psycopg2 binary for OS X.

  • postgresql , , , , psycopg2. postgres.

  • , postgres psycopg2, pg_config, . :

    . pg_config ( /usr/local/pgsql/bin/, postgres , .

    . setup.cfg psycopg2 pg_config , pg_config=. , . postgres, , :

    pg_config=/usr/local/pgsql/bin/pg_config

+11

MacPorts Snow Leopard

pg_config=/opt/local/lib/postgresql90/bin/pg_config
+3

psycopg2 virtualenv, , postgreSQL , , , , .

  • postgres.app Applications.

  • postgres.app bin PATH:

export PATH = $PATH:/Applications/Postgres.app/Contents/Versions/9.3/bin

  1. virtualenv:

. myvenv//

  1. pip install psycopg2

pg_config, . pip , , pg_config .

, , PostgreSQL , , , , - . - . PostgreSQL .

0

Source: https://habr.com/ru/post/1708048/


All Articles