Обсуждение: Need help with the installation of psycopg2 module in a python virtual env

Поиск
Список
Период
Сортировка

Need help with the installation of psycopg2 module in a python virtual env

От
"Vamsi Krishna Reddy -T (vamsredd - TATA CONSULTANCY SERVICES LIMITED at Cisco)"
Дата:

 

Hi Team

 

I am trying to install psycopg2 in one of the cisco customized python virtual env  using pip  (pip3.4  --proxy <proxy_url> install psycopg2).

Python available in this env is python.3.4   32-bit version.

I have also installed 32 bit version of postgress libraries.

 

I get the below error from gcc.

 

creating build/temp.linux-x86_64-3.4/psycopg

 

gcc -pthread -m32 -Werror=declaration-after-statement -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -m32 -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.6 (dt dec pq3 ext)" -DPG_VERSION_HEX=0x080414 -I/ws/vamsredd-bxb/pyats_cel/include -I/auto/pysw/cel63/python/3.4.1/include/python3.4m -I. -I/usr/include -I/usr/include/pgsql/server -c psycopg/psycopgmodule.c -o build/temp.linux-x86_64-3.4/psycopg/psycopgmodule.o -Wdeclaration-after-statement

 

gcc.orig: (dt: No such file or directory

 

gcc.orig: dec: No such file or directory

 

gcc.orig: pq3: No such file or directory

 

gcc.orig: ext)": No such file or directory

 

<command-line>: warning: missing terminating " character

 

psycopg/psycopgmodule.c: In function 'PyInit__psycopg':

 

psycopg/psycopgmodule.c:877: error: missing terminating " character

 

psycopg/psycopgmodule.c:877: error: expected expression before ')' token

 

error: command 'gcc' failed with exit status 1

 

----------------------------------------

Cleaning up...

Command /ws/vamsredd-bxb/pyats_cel/bin/python3.4 -c "import setuptools, tokenize;__file__='/ws/vamsredd-bxb/pyats_cel/build/psycopg2/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-5pc5uaux-record/install-record.txt --single-version-externally-managed --compile --install-headers /ws/vamsredd-bxb/pyats_cel/include/site/python3.4 failed with error code 1 in /ws/vamsredd-bxb/pyats_cel/build/psycopg2

Storing debug log for failure in /users/vamsredd/.pip/pip.log

 

Any help is highly appreciated.

 

Thanks & Regards

Vamsi

 

 

 

 

http://www.cisco.com/web/europe/images/email/signature/logo05.jpg

Vamsi Krishna Reddy
Engineer - Test/QA
vamsredd@cisco.com
Phone: +1 978 936 3645

Cisco Systems Limited
300 Beaver Brook Road
BOXBOROUGH
MASSACHUSETTS
01719
US
Cisco.com

 

Think before you print.Think before you print.

This email may contain confidential and privileged material for the sole use of the intended recipient. Any review, use, distribution or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive for the recipient), please contact the sender by reply email and delete all copies of this message.

For corporate legal information go to:
http://www.cisco.com/web/about/doing_business/legal/cri/index.html

 

 

Вложения

Re: Need help with the installation of psycopg2 module in a python virtual env

От
Adrian Klaver
Дата:
On 04/17/2015 11:27 AM, Vamsi Krishna Reddy -T (vamsredd - TATA
CONSULTANCY SERVICES LIMITED at Cisco) wrote:
> Hi Team
>
> I am trying to install psycopg2 in one of the cisco customized python
> virtual env  using pip  (pip3.4  --proxy <proxy_url> install psycopg2).
>
> Python available in this env is python.3.4 32-bit version.
>
> I have also installed 32 bit version of postgress libraries.
>
> I get the below error from gcc.
>
> creating build/temp.linux-x86_64-3.4/psycopg
>
> gcc -pthread -m32 -Werror=declaration-after-statement -DNDEBUG -g
> -fwrapv -O3 -Wall -Wstrict-prototypes -m32 -fPIC
> -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.6 (dt dec pq3 ext)"
> -DPG_VERSION_HEX=0x080414 -I/ws/vamsredd-bxb/pyats_cel/include
> -I/auto/pysw/cel63/python/3.4.1/include/python3.4m -I. -I/usr/include
> -I/usr/include/pgsql/server -c psycopg/psycopgmodule.c -o
> build/temp.linux-x86_64-3.4/psycopg/psycopgmodule.o
> -Wdeclaration-after-statement
>
> gcc.orig: (dt: No such file or directory
>
> gcc.orig: dec: No such file or directory
>
> gcc.orig: pq3: No such file or directory
>
> gcc.orig: ext)": No such file or directory
>
> <command-line>: warning: missing terminating " character
>
> psycopg/psycopgmodule.c: In function 'PyInit__psycopg':
>
> psycopg/psycopgmodule.c:877: error: missing terminating " character
>
> psycopg/psycopgmodule.c:877: error: expected expression before ')' token
>
> error: command 'gcc' failed with exit status 1
>
> ----------------------------------------

Best guess is you do not have the python-dev files installed. See below
for more details:

http://initd.org/psycopg/docs/install.html

>
> *Vamsi Krishna Reddy*
> Engineer - Test/QA
> vamsredd@cisco.com
> Phone: *+1 978 936 3645*
>


--
Adrian Klaver
adrian.klaver@aklaver.com


Re: Need help with the installation of psycopg2 module in a python virtual env

От
Daniele Varrazzo
Дата:
Hello,

On Fri, Apr 17, 2015 at 7:27 PM, Vamsi Krishna Reddy -T (vamsredd -
TATA CONSULTANCY SERVICES LIMITED at Cisco) <vamsredd@cisco.com>
wrote:
> gcc -pthread -m32 -Werror=declaration-after-statement -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -m32 -fPIC
-DPSYCOPG_DEFAULT_PYDATETIME=1-DPSYCOPG_VERSION="2.6 (dt dec pq3 ext)" -DPG_VERSION_HEX=0x080414
-I/ws/vamsredd-bxb/pyats_cel/include-I/auto/pysw/cel63/python/3.4.1/include/python3.4m -I. -I/usr/include
-I/usr/include/pgsql/server-c psycopg/psycopgmodule.c -o build/temp.linux-x86_64-3.4/psycopg/psycopgmodule.o
-Wdeclaration-after-statement
>
> gcc.orig: (dt: No such file or directory
> gcc.orig: dec: No such file or directory
> gcc.orig: pq3: No such file or directory
> gcc.orig: ext)": No such file or directory
> <command-line>: warning: missing terminating " character
> psycopg/psycopgmodule.c: In function 'PyInit__psycopg':
> psycopg/psycopgmodule.c:877: error: missing terminating " character
> psycopg/psycopgmodule.c:877: error: expected expression before ')' token
> error: command 'gcc' failed with exit status 1

This is strange: it seems a problem with the quotes in the shell. What
is the shell used by your appliance?

The command seems ok in itself, but from the errors it seems that
-DPSYCOPG_VERSION= is parsed without accounting for the quotes, so it
stops at the 2.6 and the rest of the string is taken as separate
tokens. Even the closing quote after 'ext)' is joined to the string,
reinforcing the impression.

What happens if you run the above command pasting it in the shell?

It seems that your "gcc" command is a wrapper calling into "gcc.orig".
I suspect there's a bug in that wrapper messing up with the quotes.

-- Daniele


Re: Need help with the installation of psycopg2 module in a python virtual env

От
Daniele Varrazzo
Дата:
On Sun, Apr 19, 2015 at 9:56 AM, Daniele Varrazzo
<daniele.varrazzo@gmail.com> wrote:

> It seems that your "gcc" command is a wrapper calling into "gcc.orig".
> I suspect there's a bug in that wrapper messing up with the quotes.

Further evidence here:

http://diswww.mit.edu/menelaus.mit.edu/kerberos/32575

There's also a hint about how to fix the problem: if arguments are
forwarded using $* in the wrapper, they should be forwarded with "$@"
(with the quotes) instead.

-- Daniele


Re: Need help with the installation of psycopg2 module in a python virtual env

От
"Vamsi Krishna Reddy -T (vamsredd - TATA CONSULTANCY SERVICES LIMITED at Cisco)"
Дата:
Hi Daniele

Thanks a lot for your support.

Yes, the problem is with gcc wrapper . I have added "" around $@ in gcc wrapper script.
I am able to build 32 bit version psycopg2 module.

Thanks & Regards
Vamsi Krishna





Think before you print.
This email may contain confidential and privileged material for the sole use of the intended recipient. Any review,
use,distribution  
or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive for the
recipient), 
please contact the sender by reply email and delete all copies of this message.
For corporate legal information go to:
http://www.cisco.com/web/about/doing_business/legal/cri/index.html


-----Original Message-----
From: Daniele Varrazzo [mailto:daniele.varrazzo@gmail.com]
Sent: Sunday, April 19, 2015 5:01 AM
To: Vamsi Krishna Reddy -T (vamsredd - TATA CONSULTANCY SERVICES LIMITED at Cisco)
Cc: psycopg@postgresql.org; Virag Jain (virajain)
Subject: Re: [psycopg] Need help with the installation of psycopg2 module in a python virtual env

On Sun, Apr 19, 2015 at 9:56 AM, Daniele Varrazzo <daniele.varrazzo@gmail.com> wrote:

> It seems that your "gcc" command is a wrapper calling into "gcc.orig".
> I suspect there's a bug in that wrapper messing up with the quotes.

Further evidence here:

http://diswww.mit.edu/menelaus.mit.edu/kerberos/32575

There's also a hint about how to fix the problem: if arguments are forwarded using $* in the wrapper, they should be
forwardedwith  
"$@"
(with the quotes) instead.

-- Daniele

Вложения