1

I installed python2.7 on my

centos 2.6.32-431.17.1.el6.x86_64

following these directions:

http://toomuchdata.com/2014/02/16/how-to-install-python-on-centos/

#after the yum stuff...
# Python 2.7.6:
wget http://python.org/ftp/python/2.7.6/Python-2.7.6.tar.xz
tar xf Python-2.7.6.tar.xz
cd Python-2.7.6
./configure --prefix=/usr/local --enable-unicode=ucs4 --enable-shared LDFLAGS="-Wl,-rpath /usr/local/lib"
make && make altinstall

I am trying to install psycopg2:

[stuff]# pip2.7 install psycopg2
...
./psycopg/psycopg.h:31:22: error: libpq-fe.h: No such file or directory

Upon researching, that means I need to install python-devel (I think), but I can't install this because it would install for my 2.6 default on the system.

I tried to install from source:

[stuff]# python2.7  ./external_dependancies/psycopg2-2.5.3/setup.py install
Traceback (most recent call last):
  File "./external_dependancies/psycopg2-2.5.3/setup.py", line 474, in <module>
    use_pydatetime  = int(parser.get('build_ext', 'use_pydatetime'))
  File "/usr/local/lib/python2.7/ConfigParser.py", line 607, in get
    raise NoSectionError(section)
ConfigParser.NoSectionError: No section: 'build_ext'

What do I need to do to get python-devel (or better yet, psycopg2) on my system

  • why not using pip and virtualenv to install a specific version of python in a directory? – Braiam Jul 17 '14 at 19:48
  • I'd still need the python-devel, right? Isn't that a system package, not a python environment package? – Jeff Jul 18 '14 at 0:44
0

I was missing this package:

libpqxx-devel.x86_64

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.