Installing psycopg2 into virtualenv when PostgreSQL is not installed on development system

前端 未结 14 1177
一向
一向 2020-12-04 09:24

Is it possible to install psycopg2 into a virtualenv when PostgreSQL isn\'t installed on my development system—MacBook Pro with OS X 10.6?

When I run

14条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-04 09:39

    psycopg depends on pg_config command, and if you don't have it, you can't install psycopg.

    If system installation is a problem to you, why don't you try compiling PostgreSQL and including generated bin files in your $PATH? Like:

    export PATH=/path/to/compiled/postgresql/bin:"$PATH"
    pip install psycopg2
    

提交回复
热议问题