Why can not I install psycopg2? (Python 2.6.4, PostgreSQL 8.4, OS X 10.6.3)

ORIGINAL MESSAGE (now deprecated):

After starting the python setup.py installation, I get the following:

Warning: Unable to find 'pg_config' filebuilding 'psycopg2._psycopg' extension
gcc-4.0 -arch ppc -arch i386 -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -O3 -   DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.2.1 (dt dec ext pq3)" -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -DHAVE_PQPROTOCOL3=1 -I/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -I. -c psycopg/psycopgmodule.c -o build/temp.macosx-10.3-fat-2.6/psycopg/psycopgmodule.o
unable to execute gcc-4.0: No such file or directory
error: command 'gcc-4.0' failed with exit status 1

Probably, there is something loudly obvious to everyone who knows what is happening with web programming in the background, but, unfortunately, I liked it all. The psycopg2 documentation did not help.


UPDATE early June 12th. . After updating all my software, the error message has changed.

Now when I run "python setup.py install", I get the following:

Warning: Unable to find 'pg_config' filebuilding 'psycopg2._psycopg' extension
gcc-4.0 -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -O3 -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.2.1 (dt dec ext pq3)" -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -DHAVE_PQPROTOCOL3=1 -I/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -I. -c psycopg/psycopgmodule.c -o build/temp.macosx-10.3-fat-2.6/psycopg/psycopgmodule.o

followed by a very long list of other error messages.

This may or may not be relevant, when I add "gcc-4.0" to Terminal, it returns with:

i686-apple-darwin10-gcc-4.0.1: no input files

12:41 GMT 12 : , macports , , :

raise ImproperlyConfigured("Error loading psycopg2 module: %s" % e)
django.core.exceptions.ImproperlyConfigured: Error loading psycopg2 module: No module named psycopg2

, , , psycopg2 . .

+3
5

, , . , setup.py, MacPorts :

sudo port install py26-psycopg2

+3

(. )

"gcc4.0" , python /. XCode/Developer ( GCC) DVD- OSX.

, , ... -, ( , ), . , gobbledegook, , - Google , . , , ", gcc4.0. , , , python, , python , - ". , , .

: psycopg2 python, C. python C, python, C , - python. , python. C ( python, ), gcc4.0. , , Windows Linux, psycopg2 , GCC, ( ). , , OS X, "gcc4.0" , PATH, script, . OS X DVD-, . . , , , GCC 4.0, "gcc4.0" , .

, GCC 4.0! . :

>gcc4.0
i686-apple-darwin10-gcc-4.0.1: no input files

, , , , . , psycopg2 script , .

, , psycopg2 , PostgreSQL. , MacPorts, :

sudo port install postgresql-server-devel

pg_config, .

!

+8

postgres Enterprise DB,

export PATH=$PATH:/Library/PostgreSQL/8.4/bin

- , .

cc1: error: unrecognized command line option "-Wno-long-double"

gcc - gcc, gcc4.0, :

alias gcc=/usr/bin/gcc-4.0

easy_install.

+4

, " ", , , , . , PostgreSQL Mac. , psycopg2 "pg_config", , " " pg_config ".

, , , PostgreSQL. , pg_config setup.cfg psycopg. "python setup.py install" , . , ""; , , .

+2
PATH=$PATH:/Library/PostgreSQL/9.0/bin/ sudo easy_install psycopg2
+2

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


All Articles