pygresql

Discussion in 'Python' started by JD, Nov 4, 2007.

  1. JD

    JD Guest

    Hi there.

    I'm trying to use python with postgresql. I decided to use psycopg to
    interact with the postgresql server. When installing psycopg it
    appeared that I needed mxDateTime. So I decided to install the mxbase
    package.

    I received the following error message (the interesting bit seems to
    be at the end):


    james@ubuntu-server:/var/lib/postgresql/mxbase$ sudo python setup.py
    install
    running install
    running build
    running mx_autoconf
    gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O2 -Wall -Wstrict-
    prototypes -fPIC -D_GNU_SOURCE=1 -I/usr/local/include -I/usr/include -
    c _configtest.c -o _configtest.o
    _configtest.c: In function 'main':
    _configtest.c:4: warning: statement with no effect
    gcc -pthread _configtest.o -L/usr/local/lib -o _configtest
    success!
    removing: _configtest.c _configtest.o _configtest
    gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O2 -Wall -Wstrict-
    prototypes -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.5 -I/usr/local/
    include -I/usr/include -c _configtest.c -o _configtest.o
    success!
    removing: _configtest.c _configtest.o
    macros to define: [('HAVE_STRPTIME', '1')]
    macros to undefine: []
    running build_ext

    building extension "mx.DateTime.mxDateTime.mxDateTime" (required)
    building 'mx.DateTime.mxDateTime.mxDateTime' extension
    gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O2 -Wall -Wstrict-
    prototypes -fPIC -DUSE_FAST_GETCURRENTTIME -DHAVE_STRPTIME=1 -Imx/
    DateTime/mxDateTime -I/usr/include/python2.5 -I/usr/local/include -I/
    usr/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.linux-
    i686-2.5_ucs4/mx-DateTime-mxDateTime-mxDateTime/mx/DateTime/mxDateTime/
    mxDateTime.o
    gcc: mx/DateTime/mxDateTime/mxDateTime.c: No such file or directory
    gcc: no input files
    error: command 'gcc' failed with exit status 1


    I googled "error: command 'gcc' failed with exit status 1" and
    interestingly a lot of the results seemed to be linked with python. I
    can confirm that I do have gcc installed. One post seemed to suggest
    that I may be using too new a version of gcc. Do you think this is the
    problem or am I going astray somewhere else?

    Thank you very much in advance for any assistance,
    James.
    JD, Nov 4, 2007
    #1
    1. Advertising

  2. JD

    JD Guest

    Btw apologies for naming the post 'pygresql'! That was the module I
    was attempting to use before.
    JD, Nov 4, 2007
    #2
    1. Advertising

  3. JD

    JD Guest

    Apologies for essentially talking to myself out loud!

    I've switched back to pygresql. I think a lot of my problems were
    caused by not having installed postgresql-server-dev-8.2 which
    contains a lot of header files etc. I'm sure this was part of the
    problem with the psycopg modules aswell.

    postgresql-server-dev can easily be installed of course by using:

    sudo apt-get install postgresql-server-dev

    I hope my ramblings have been of help to someone!
    JD, Nov 4, 2007
    #3
  4. JD

    rustom Guest

    On Nov 4, 8:45 pm, JD <> wrote:
    > Hi there.
    >
    > I'm trying to use python with postgresql. I decided to use psycopg to
    > interact with the postgresql server. When installing psycopg it
    > appeared that I needed mxDateTime. So I decided to install the mxbase
    > package.
    >
    > I received the following error message (the interesting bit seems to
    > be at the end):


    snipped

    > Thank you very much in advance for any assistance,
    > James.


    Why are you trying to install yourself instead of using apt? On my
    debian etch box the psycopg packages have dependencies to the python-
    egenix-mx* packages and installing psycopg pulls in the others without
    problems. And I guess ubuntu should be similar.
    rustom, Nov 4, 2007
    #4
  5. JD

    Erik Jones Guest

    On Nov 4, 2007, at 9:45 AM, JD wrote:

    > Hi there.
    >
    > I'm trying to use python with postgresql. I decided to use psycopg to
    > interact with the postgresql server. When installing psycopg it
    > appeared that I needed mxDateTime. So I decided to install the mxbase
    > package.
    >
    > I received the following error message (the interesting bit seems to
    > be at the end):
    >
    >
    > james@ubuntu-server:/var/lib/postgresql/mxbase$ sudo python setup.py
    > install
    > running install
    > running build
    > running mx_autoconf
    > gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O2 -Wall -Wstrict-
    > prototypes -fPIC -D_GNU_SOURCE=1 -I/usr/local/include -I/usr/include -
    > c _configtest.c -o _configtest.o
    > _configtest.c: In function 'main':
    > _configtest.c:4: warning: statement with no effect
    > gcc -pthread _configtest.o -L/usr/local/lib -o _configtest
    > success!
    > removing: _configtest.c _configtest.o _configtest
    > gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O2 -Wall -Wstrict-
    > prototypes -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.5 -I/usr/
    > local/
    > include -I/usr/include -c _configtest.c -o _configtest.o
    > success!
    > removing: _configtest.c _configtest.o
    > macros to define: [('HAVE_STRPTIME', '1')]
    > macros to undefine: []
    > running build_ext
    >
    > building extension "mx.DateTime.mxDateTime.mxDateTime" (required)
    > building 'mx.DateTime.mxDateTime.mxDateTime' extension
    > gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O2 -Wall -Wstrict-
    > prototypes -fPIC -DUSE_FAST_GETCURRENTTIME -DHAVE_STRPTIME=1 -Imx/
    > DateTime/mxDateTime -I/usr/include/python2.5 -I/usr/local/include -I/
    > usr/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/
    > temp.linux-
    > i686-2.5_ucs4/mx-DateTime-mxDateTime-mxDateTime/mx/DateTime/
    > mxDateTime/
    > mxDateTime.o
    > gcc: mx/DateTime/mxDateTime/mxDateTime.c: No such file or directory
    > gcc: no input files
    > error: command 'gcc' failed with exit status 1
    >
    >
    > I googled "error: command 'gcc' failed with exit status 1" and
    > interestingly a lot of the results seemed to be linked with python. I
    > can confirm that I do have gcc installed. One post seemed to suggest
    > that I may be using too new a version of gcc. Do you think this is the
    > problem or am I going astray somewhere else?
    >
    > Thank you very much in advance for any assistance,
    > James.


    You shouldn't be using psycopg, it's not supported anymore. Use
    psycopg2 which is in active development and has no dependecies on any
    of the mx libraries.

    Erik Jones

    Software Developer | Emma®

    800.595.4401 or 615.292.5888
    615.292.0777 (fax)

    Emma helps organizations everywhere communicate & market in style.
    Visit us online at http://www.myemma.com
    Erik Jones, Nov 4, 2007
    #5
  6. In article <>,
    JD <> wrote:

    > Hi there.
    >
    > I'm trying to use python with postgresql. I decided to use psycopg to
    > interact with the postgresql server. When installing psycopg it
    > appeared that I needed mxDateTime. So I decided to install the mxbase
    > package.


    I see that you've already solved your problem, but I'll add that
    psycopg2 will use mxDateTime if it is installed, but it isn't required.

    --
    Philip
    http://NikitaTheSpider.com/
    Whole-site HTML validation, link checking and more
    Nikita the Spider, Nov 4, 2007
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. trewornan

    pygresql

    trewornan, Jun 28, 2003, in forum: Python
    Replies:
    1
    Views:
    779
    Skip Montanaro
    Jun 28, 2003
  2. Benjamin Arai
    Replies:
    0
    Views:
    265
    Benjamin Arai
    Feb 1, 2004
  3. Radu Stanciu
    Replies:
    2
    Views:
    335
    =?ISO-8859-1?Q?Gerhard_H=E4ring?=
    Feb 18, 2004
  4. Chuck Amadi
    Replies:
    4
    Views:
    823
    =?ISO-8859-1?Q?Gerhard_H=E4ring?=
    Jun 19, 2004
  5. Neil Zanella

    PyQt + PygreSQL

    Neil Zanella, Aug 10, 2004, in forum: Python
    Replies:
    2
    Views:
    765
    Neil Zanella
    Aug 11, 2004
Loading...

Share This Page