I'm trying to config Django on centos 7
According to this article Here
I installed
sudo yum install python-pip python-devel postgresql-server postgresql-devel postgresql-contrib gcc nginx
After setup PostgreSQL for Django like creating a database, ...
I try installing psycopg2 on virtualenv
pip install django gunicorn psycopg2
but I got this error,
Anyone can help me?
Collecting psycopg2
Using cached psycopg2-2.6.2.tar.gz
Installing collected packages: psycopg2
Running setup.py install for psycopg2 ... error
Complete output from command /usr/bin/python3.4 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-n0buiow5/psycopg2/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-jk1w8dv1-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.4
creating build/lib.linux-x86_64-3.4/psycopg2
copying lib/tz.py -> build/lib.linux-x86_64-3.4/psycopg2
copying lib/pool.py -> build/lib.linux-x86_64-3.4/psycopg2
copying lib/extras.py -> build/lib.linux-x86_64-3.4/psycopg2
copying lib/extensions.py -> build/lib.linux-x86_64-3.4/psycopg2
copying lib/_range.py -> build/lib.linux-x86_64-3.4/psycopg2
copying lib/__init__.py -> build/lib.linux-x86_64-3.4/psycopg2
copying lib/psycopg1.py -> build/lib.linux-x86_64-3.4/psycopg2
copying lib/_json.py -> build/lib.linux-x86_64-3.4/psycopg2
copying lib/errorcodes.py -> build/lib.linux-x86_64-3.4/psycopg2
creating build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/test_errcodes.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/dbapi20.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/test_bug_gc.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/test_async.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/testconfig.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/test_quote.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/test_extras_dictcursor.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/test_types_basic.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/test_transaction.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/test_cancel.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/test_dates.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/test_lobject.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/dbapi20_tpc.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/test_copy.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/test_types_extras.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/test_psycopg2_dbapi20.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/test_module.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/__init__.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/test_green.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/testutils.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/test_with.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/test_cursor.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/test_connection.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/test_notify.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/test_bugX000.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
Skipping optional fixer: buffer
Skipping optional fixer: idioms
Skipping optional fixer: set_literal
Skipping optional fixer: ws_comma
running build_ext
building 'psycopg2._psycopg' extension
creating build/temp.linux-x86_64-3.4
creating build/temp.linux-x86_64-3.4/psycopg
gcc -pthread -Wno-unused-result -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.6.2 (dt dec pq3 ext)" -DPG_VERSION_HEX=0x090212 -I/usr/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
In file included from psycopg/psycopgmodule.c:27:0:
./psycopg/psycopg.h:30:20: fatal error: Python.h: No such file or directory
#include <Python.h>
^
compilation terminated.
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python3.4 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-n0buiow5/psycopg2/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-jk1w8dv1-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-n0buiow5/psycopg2/
Tested with Python 3:
sudo yum groupinstall "Development Tools"
sudo yum install python3-devel
sudo yum install postgresql-libs
sudo yum install postgresql-devel
[sudo] pip install psycopg2
http://mirror.centos.org/centos/7/os/x86_64/Packages/
Test this
yum install python-psycopg2
You seem to be missing a
sudo yum install postgresql-libs
The installation of postgresql-libs does not help, it actually needs a valid postgresql client. Therefore installing the devel package for CentOS 7 solves it (if it's not an overkill for you).
yum install postgresql-devel
This started happening due to the fact that the pip package stopped shipping with postgresql client binaries, which makes sense since you might want to use a different version in certain scenarios.
Related
This question already has an answer here:
Error on "pip install -U channels" command using for otree (Running setup.py bdist_wheel for twisted ... error)
(1 answer)
Closed 1 year ago.
while trying to do
pip install web3
I am always getting the following error
Building wheel for cytoolz (setup.py) ... error ERROR: Command
errored out with exit status 1: command:
/Library/Frameworks/Python.framework/Versions/3.10/bin/python3 -u -c
'import io, os, sys, setuptools, tokenize; sys.argv[0] =
'"'"'/private/var/folders/gb/5fvn1z1s689bzt7vbll5845c0000gn/T/pip-install-cxwpjegv/cytoolz_88244d2146254468892c582d0b9e33fa/setup.py'"'"';
file='"'"'/private/var/folders/gb/5fvn1z1s689bzt7vbll5845c0000gn/T/pip-install-cxwpjegv/cytoolz_88244d2146254468892c582d0b9e33fa/setup.py'"'"';f
= getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import
setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"',
'"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))'
bdist_wheel -d
/private/var/folders/gb/5fvn1z1s689bzt7vbll5845c0000gn/T/pip-wheel-ljv1jb3k
cwd: /private/var/folders/gb/5fvn1z1s689bzt7vbll5845c0000gn/T/pip-install-cxwpjegv/cytoolz_88244d2146254468892c582d0b9e33fa/
Complete output (56 lines): [1/5] Cythonizing cytoolz/utils.pyx
[2/5] Cythonizing cytoolz/dicttoolz.pyx [3/5] Cythonizing
cytoolz/functoolz.pyx [4/5] Cythonizing cytoolz/itertoolz.pyx
[5/5] Cythonizing cytoolz/recipes.pyx running bdist_wheel running
build running build_py creating build creating
build/lib.macosx-10.9-universal2-3.10 creating
build/lib.macosx-10.9-universal2-3.10/cytoolz copying
cytoolz/compatibility.py ->
build/lib.macosx-10.9-universal2-3.10/cytoolz copying
cytoolz/_version.py -> build/lib.macosx-10.9-universal2-3.10/cytoolz
copying cytoolz/init.py ->
build/lib.macosx-10.9-universal2-3.10/cytoolz copying
cytoolz/_signatures.py ->
build/lib.macosx-10.9-universal2-3.10/cytoolz creating
build/lib.macosx-10.9-universal2-3.10/cytoolz/curried copying
cytoolz/curried/operator.py ->
build/lib.macosx-10.9-universal2-3.10/cytoolz/curried copying
cytoolz/curried/init.py ->
build/lib.macosx-10.9-universal2-3.10/cytoolz/curried copying
cytoolz/curried/exceptions.py ->
build/lib.macosx-10.9-universal2-3.10/cytoolz/curried copying
cytoolz/itertoolz.pyx -> build/lib.macosx-10.9-universal2-3.10/cytoolz
copying cytoolz/dicttoolz.pyx ->
build/lib.macosx-10.9-universal2-3.10/cytoolz copying
cytoolz/functoolz.pyx -> build/lib.macosx-10.9-universal2-3.10/cytoolz
copying cytoolz/recipes.pyx ->
build/lib.macosx-10.9-universal2-3.10/cytoolz copying
cytoolz/utils.pyx -> build/lib.macosx-10.9-universal2-3.10/cytoolz
copying cytoolz/utils.pxd ->
build/lib.macosx-10.9-universal2-3.10/cytoolz copying
cytoolz/init.pxd -> build/lib.macosx-10.9-universal2-3.10/cytoolz
copying cytoolz/recipes.pxd ->
build/lib.macosx-10.9-universal2-3.10/cytoolz copying
cytoolz/functoolz.pxd -> build/lib.macosx-10.9-universal2-3.10/cytoolz
copying cytoolz/dicttoolz.pxd ->
build/lib.macosx-10.9-universal2-3.10/cytoolz copying
cytoolz/cpython.pxd -> build/lib.macosx-10.9-universal2-3.10/cytoolz
copying cytoolz/itertoolz.pxd ->
build/lib.macosx-10.9-universal2-3.10/cytoolz creating
build/lib.macosx-10.9-universal2-3.10/cytoolz/tests copying
cytoolz/tests/test_none_safe.py ->
build/lib.macosx-10.9-universal2-3.10/cytoolz/tests copying
cytoolz/tests/test_utils.py ->
build/lib.macosx-10.9-universal2-3.10/cytoolz/tests copying
cytoolz/tests/test_curried.py ->
build/lib.macosx-10.9-universal2-3.10/cytoolz/tests copying
cytoolz/tests/test_compatibility.py ->
build/lib.macosx-10.9-universal2-3.10/cytoolz/tests copying
cytoolz/tests/test_embedded_sigs.py ->
build/lib.macosx-10.9-universal2-3.10/cytoolz/tests copying
cytoolz/tests/test_functoolz.py ->
build/lib.macosx-10.9-universal2-3.10/cytoolz/tests copying
cytoolz/tests/test_inspect_args.py ->
build/lib.macosx-10.9-universal2-3.10/cytoolz/tests copying
cytoolz/tests/test_doctests.py ->
build/lib.macosx-10.9-universal2-3.10/cytoolz/tests copying
cytoolz/tests/test_tlz.py ->
build/lib.macosx-10.9-universal2-3.10/cytoolz/tests copying
cytoolz/tests/test_signatures.py ->
build/lib.macosx-10.9-universal2-3.10/cytoolz/tests copying
cytoolz/tests/dev_skip_test.py ->
build/lib.macosx-10.9-universal2-3.10/cytoolz/tests copying
cytoolz/tests/test_recipes.py ->
build/lib.macosx-10.9-universal2-3.10/cytoolz/tests copying
cytoolz/tests/test_docstrings.py ->
build/lib.macosx-10.9-universal2-3.10/cytoolz/tests copying
cytoolz/tests/test_dev_skip_test.py ->
build/lib.macosx-10.9-universal2-3.10/cytoolz/tests copying
cytoolz/tests/test_dicttoolz.py ->
build/lib.macosx-10.9-universal2-3.10/cytoolz/tests copying
cytoolz/tests/test_serialization.py ->
build/lib.macosx-10.9-universal2-3.10/cytoolz/tests copying
cytoolz/tests/test_curried_toolzlike.py ->
build/lib.macosx-10.9-universal2-3.10/cytoolz/tests copying
cytoolz/tests/test_itertoolz.py ->
build/lib.macosx-10.9-universal2-3.10/cytoolz/tests running
build_ext creating build/temp.macosx-10.9-universal2-3.10 creating
build/temp.macosx-10.9-universal2-3.10/cytoolz clang
-Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10
-c cytoolz/dicttoolz.c -o build/temp.macosx-10.9-universal2-3.10/cytoolz/dicttoolz.o xcrun:
error: invalid active developer path
(/Library/Developer/CommandLineTools), missing xcrun at:
/Library/Developer/CommandLineTools/usr/bin/xcrun error: command
'/usr/bin/clang' failed with exit code 1
---------------------------------------- ERROR: Failed building wheel for cytoolz
I have tried to update wheel, installing with sudo, and nothing worked so far,
would love for some help,
thanks
Solution was to install xcode tools using
xcode-select --install
I am trying to get my django application to use PostgreSQL, however, so far no luck. I set the application to use the PostgreSQL database and linked both containers using docker-compose.yml, but I am getting the error that the module psycopg2 is missing. I installed all of the dependencies as follow: apk --update add python3-dev, postgresql-client, postgresql-dev, musl-dev and when I try to install psycopg2 using pip pip3 install psycopg2 I get the following error:
Collecting psycopg2
Downloading psycopg2-2.6.2.tar.gz (376kB)
Installing collected packages: psycopg2
Running setup.py install for psycopg2
building 'psycopg2._psycopg' extension
gcc -Wno-unused-result -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Os -fomit-frame-pointer -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.6.2 (dt dec pq3 ext lo64)" -DPG_VERSION_HEX=0x090409 -DHAVE_LO64=1 -I/usr/include/python3.4m -I. -I/usr/include -I/usr/include/postgresql/server -c psycopg/psycopgmodule.c -o build/temp.linux-x86_64-3.4/psycopg/psycopgmodule.o -Wdeclaration-after-statement
error: command 'gcc' failed with exit status 1
Complete output from command /usr/bin/python3.4 -c "import setuptools, tokenize;__file__='/tmp/pip-build-6wmwilb_/psycopg2/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-f8ye_ro8-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.4
creating build/lib.linux-x86_64-3.4/psycopg2
copying lib/_json.py -> build/lib.linux-x86_64-3.4/psycopg2
copying lib/psycopg1.py -> build/lib.linux-x86_64-3.4/psycopg2
copying lib/pool.py -> build/lib.linux-x86_64-3.4/psycopg2
copying lib/__init__.py -> build/lib.linux-x86_64-3.4/psycopg2
copying lib/extensions.py -> build/lib.linux-x86_64-3.4/psycopg2
copying lib/errorcodes.py -> build/lib.linux-x86_64-3.4/psycopg2
copying lib/extras.py -> build/lib.linux-x86_64-3.4/psycopg2
copying lib/tz.py -> build/lib.linux-x86_64-3.4/psycopg2
copying lib/_range.py -> build/lib.linux-x86_64-3.4/psycopg2
creating build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/test_notify.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/test_lobject.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/test_errcodes.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/dbapi20.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/dbapi20_tpc.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/test_types_basic.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/test_dates.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/test_bugX000.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/test_copy.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/test_module.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/test_async.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/testutils.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/__init__.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/test_cancel.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/test_quote.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/test_psycopg2_dbapi20.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/test_with.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/testconfig.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/test_transaction.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/test_green.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/test_types_extras.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/test_cursor.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/test_connection.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/test_bug_gc.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/test_extras_dictcursor.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
Skipping implicit fixer: buffer
Skipping implicit fixer: idioms
Skipping implicit fixer: set_literal
Skipping implicit fixer: ws_comma
running build_ext
building 'psycopg2._psycopg' extension
creating build/temp.linux-x86_64-3.4
creating build/temp.linux-x86_64-3.4/psycopg
gcc -Wno-unused-result -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Os -fomit-frame-pointer -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.6.2 (dt dec pq3 ext lo64)" -DPG_VERSION_HEX=0x090409 -DHAVE_LO64=1 -I/usr/include/python3.4m -I. -I/usr/include -I/usr/include/postgresql/server -c psycopg/psycopgmodule.c -o build/temp.linux-x86_64-3.4/psycopg/psycopgmodule.o -Wdeclaration-after-statement
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python3.4 -c "import setuptools, tokenize;__file__='/tmp/pip-build-6wmwilb_/psycopg2/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-f8ye_ro8-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-6wmwilb_/psycopg2
Am I missing a dependency or am I installing psycopg2 wrong?
Add this in the Dockerfile of your django app
RUN apk add build-base
It is like build-essentials, include basic build tools for compiling C/C++
programs
Getting the following errors when I do: pip install lxml
You are using pip version 6.0.8, however version 7.1.0 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Collecting lxml
Using cached lxml-3.4.4.tar.gz
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'bugtrack_url'
warnings.warn(msg)
Building lxml version 3.4.4.
Building without Cython.
ERROR: /bin/sh: 1: xslt-config: not found
** make sure the development packages of libxml2 and libxslt are installed **
Using build configuration of libxslt
Installing collected packages: lxml
Running setup.py install for lxml
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'bugtrack_url'
warnings.warn(msg)
Building lxml version 3.4.4.
Building without Cython.
ERROR: /bin/sh: 1: xslt-config: not found
** make sure the development packages of libxml2 and libxslt are installed **
Using build configuration of libxslt
building 'lxml.etree' extension
i686-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/tmp/pip-build-RLyvkw/lxml/src/lxml/includes -I/usr/include/python2.7 -c src/lxml/lxml.etree.c -o build/temp.linux-i686-2.7/src/lxml/lxml.etree.o -w
In file included from src/lxml/lxml.etree.c:239:0:
/tmp/pip-build-RLyvkw/lxml/src/lxml/includes/etree_defs.h:14:31: fatal error: libxml/xmlversion.h: No such file or directory
#include "libxml/xmlversion.h"
^
compilation terminated.
error: command 'i686-linux-gnu-gcc' failed with exit status 1
Complete output from command /home/apurva/.virtualenvs/universallogin/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-RLyvkw/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-9WRQzF-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/apurva/.virtualenvs/universallogin/include/site/python2.7:
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'bugtrack_url'
warnings.warn(msg)
Building lxml version 3.4.4.
Building without Cython.
ERROR: /bin/sh: 1: xslt-config: not found
** make sure the development packages of libxml2 and libxslt are installed **
Using build configuration of libxslt
running install
running build
running build_py
creating build
creating build/lib.linux-i686-2.7
creating build/lib.linux-i686-2.7/lxml
copying src/lxml/pyclasslookup.py -> build/lib.linux-i686-2.7/lxml
copying src/lxml/doctestcompare.py -> build/lib.linux-i686-2.7/lxml
copying src/lxml/sax.py -> build/lib.linux-i686-2.7/lxml
copying src/lxml/_elementpath.py -> build/lib.linux-i686-2.7/lxml
copying src/lxml/__init__.py -> build/lib.linux-i686-2.7/lxml
copying src/lxml/builder.py -> build/lib.linux-i686-2.7/lxml
copying src/lxml/ElementInclude.py -> build/lib.linux-i686-2.7/lxml
copying src/lxml/cssselect.py -> build/lib.linux-i686-2.7/lxml
copying src/lxml/usedoctest.py -> build/lib.linux-i686-2.7/lxml
creating build/lib.linux-i686-2.7/lxml/includes
copying src/lxml/includes/__init__.py -> build/lib.linux-i686-2.7/lxml/includes
creating build/lib.linux-i686-2.7/lxml/html
copying src/lxml/html/soupparser.py -> build/lib.linux-i686-2.7/lxml/html
copying src/lxml/html/html5parser.py -> build/lib.linux-i686-2.7/lxml/html
copying src/lxml/html/_setmixin.py -> build/lib.linux-i686-2.7/lxml/html
copying src/lxml/html/diff.py -> build/lib.linux-i686-2.7/lxml/html
copying src/lxml/html/formfill.py -> build/lib.linux-i686-2.7/lxml/html
copying src/lxml/html/_diffcommand.py -> build/lib.linux-i686-2.7/lxml/html
copying src/lxml/html/ElementSoup.py -> build/lib.linux-i686-2.7/lxml/html
copying src/lxml/html/__init__.py -> build/lib.linux-i686-2.7/lxml/html
copying src/lxml/html/builder.py -> build/lib.linux-i686-2.7/lxml/html
copying src/lxml/html/defs.py -> build/lib.linux-i686-2.7/lxml/html
copying src/lxml/html/_html5builder.py -> build/lib.linux-i686-2.7/lxml/html
copying src/lxml/html/usedoctest.py -> build/lib.linux-i686-2.7/lxml/html
copying src/lxml/html/clean.py -> build/lib.linux-i686-2.7/lxml/html
creating build/lib.linux-i686-2.7/lxml/isoschematron
copying src/lxml/isoschematron/__init__.py -> build/lib.linux-i686-2.7/lxml/isoschematron
copying src/lxml/lxml.etree.h -> build/lib.linux-i686-2.7/lxml
copying src/lxml/lxml.etree_api.h -> build/lib.linux-i686-2.7/lxml
copying src/lxml/includes/htmlparser.pxd -> build/lib.linux-i686-2.7/lxml/includes
copying src/lxml/includes/xinclude.pxd -> build/lib.linux-i686-2.7/lxml/includes
copying src/lxml/includes/c14n.pxd -> build/lib.linux-i686-2.7/lxml/includes
copying src/lxml/includes/xpath.pxd -> build/lib.linux-i686-2.7/lxml/includes
copying src/lxml/includes/etreepublic.pxd -> build/lib.linux-i686-2.7/lxml/includes
copying src/lxml/includes/schematron.pxd -> build/lib.linux-i686-2.7/lxml/includes
copying src/lxml/includes/xslt.pxd -> build/lib.linux-i686-2.7/lxml/includes
copying src/lxml/includes/tree.pxd -> build/lib.linux-i686-2.7/lxml/includes
copying src/lxml/includes/config.pxd -> build/lib.linux-i686-2.7/lxml/includes
copying src/lxml/includes/xmlschema.pxd -> build/lib.linux-i686-2.7/lxml/includes
copying src/lxml/includes/xmlerror.pxd -> build/lib.linux-i686-2.7/lxml/includes
copying src/lxml/includes/xmlparser.pxd -> build/lib.linux-i686-2.7/lxml/includes
copying src/lxml/includes/dtdvalid.pxd -> build/lib.linux-i686-2.7/lxml/includes
copying src/lxml/includes/uri.pxd -> build/lib.linux-i686-2.7/lxml/includes
copying src/lxml/includes/relaxng.pxd -> build/lib.linux-i686-2.7/lxml/includes
copying src/lxml/includes/etree_defs.h -> build/lib.linux-i686-2.7/lxml/includes
copying src/lxml/includes/lxml-version.h -> build/lib.linux-i686-2.7/lxml/includes
creating build/lib.linux-i686-2.7/lxml/isoschematron/resources
creating build/lib.linux-i686-2.7/lxml/isoschematron/resources/rng
copying src/lxml/isoschematron/resources/rng/iso-schematron.rng -> build/lib.linux-i686-2.7/lxml/isoschematron/resources/rng
creating build/lib.linux-i686-2.7/lxml/isoschematron/resources/xsl
copying src/lxml/isoschematron/resources/xsl/RNG2Schtrn.xsl -> build/lib.linux-i686-2.7/lxml/isoschematron/resources/xsl
copying src/lxml/isoschematron/resources/xsl/XSD2Schtrn.xsl -> build/lib.linux-i686-2.7/lxml/isoschematron/resources/xsl
creating build/lib.linux-i686-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_dsdl_include.xsl -> build/lib.linux-i686-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_abstract_expand.xsl -> build/lib.linux-i686-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_message.xsl -> build/lib.linux-i686-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_skeleton_for_xslt1.xsl -> build/lib.linux-i686-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_svrl_for_xslt1.xsl -> build/lib.linux-i686-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/readme.txt -> build/lib.linux-i686-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
running build_ext
building 'lxml.etree' extension
creating build/temp.linux-i686-2.7
creating build/temp.linux-i686-2.7/src
creating build/temp.linux-i686-2.7/src/lxml
i686-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/tmp/pip-build-RLyvkw/lxml/src/lxml/includes -I/usr/include/python2.7 -c src/lxml/lxml.etree.c -o build/temp.linux-i686-2.7/src/lxml/lxml.etree.o -w
In file included from src/lxml/lxml.etree.c:239:0:
/tmp/pip-build-RLyvkw/lxml/src/lxml/includes/etree_defs.h:14:31: fatal error: libxml/xmlversion.h: No such file or directory
#include "libxml/xmlversion.h"
^
compilation terminated.
error: command 'i686-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Command "/home/apurva/.virtualenvs/universallogin/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-RLyvkw/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-9WRQzF-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/apurva/.virtualenvs/universallogin/include/site/python2.7" failed with error code 1 in /tmp/pip-build-RLyvkw/lxml
I've already tried this: sudo apt-get install zlib1g-dev
before "pip install" reading this answer: Not able to install lxml verison 3.3.5 in ubuntu
but did not help.
Also, tried installing python-dev, python3-dev, lib-eventdev did not help either.
Also, tried doing this: STATIC_DEPS=true pip install lxml
reading this: http://lxml.de/installation.html
Did not help either!
Will be very grateful if you could suggest something
Thanks in advance.
The output states ** make sure the development packages of libxml2 and libxslt are installed **. Have you done that?
sudo apt-get install libxml2-dev libxslt-dev
Also, is there a particular reason you're install using pip instead of installing the python-lxml package that comes with Ubuntu? Installing your distribution's package should be preferred unless you have a reason to do otherwise.
if you don't need a specific version from PyPI, you can always use the version packaged for Ubuntu.
$ sudo apt-get install python-lxml
... and then allow system site packages in your virtualenv.
update:
for clarification...
pip installs python packages from PyPI by default. However, many python packages are also packaged for Ubuntu and stored in the Ubuntu archives, You can install them via your system package manager (apt-get) instead of using pip. This can be helpful as the Ubuntu packages are compiled already, and will pull in any dependencies they need.
By default, virtualenv creates an isolated python enviornment, so you don't have access to system packages (that you installed using apt-get). However, you can allow system site packages in your virtualenv.
for example, let's install lxml from it's system package, create a virtualenv named "ENV" that allows access to system packages, and then import lxml to verify it works:
$ sudo apt-get install python-lxml
$ virtualenv --system-site-packages ENV
$ source ENV/bin/activate
(ENV)$ python -c "import xml"
I am having problems with installing lxml. I have tried the solutions of the relative questions in this site and other sites but could not fix the problem. Need some suggestions/solution on this.
I am providing the full log after executing pip install lxml,
Downloading/unpacking lxml
Downloading lxml-3.3.5.tar.gz (3.5MB): 3.5MB downloaded
Running setup.py (path:/tmp/pip_build_root/lxml/setup.py) egg_info for package lxml
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'bugtrack_url'
warnings.warn(msg)
Building lxml version 3.3.5.
Building without Cython.
Using build configuration of libxslt 1.1.28
warning: no previously-included files found matching '*.py'
Installing collected packages: lxml
Running setup.py install for lxml
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'bugtrack_url'
warnings.warn(msg)
Building lxml version 3.3.5.
Building without Cython.
Using build configuration of libxslt 1.1.28
building 'lxml.etree' extension
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/libxml2 -I/tmp/pip_build_root/lxml/src/lxml/includes -I/usr/include/python2.7 -c src/lxml/lxml.etree.c -o build/temp.linux-x86_64-2.7/src/lxml/lxml.etree.o -w
x86_64-linux-gnu-gcc: internal compiler error: Killed (program cc1)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.8/README.Bugs> for instructions.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 4
Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-KUq9VD-record/install-record.txt --single-version-externally-managed --compile:
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'bugtrack_url'
warnings.warn(msg)
Building lxml version 3.3.5.
Building without Cython.
Using build configuration of libxslt 1.1.28
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/lxml
copying src/lxml/pyclasslookup.py -> build/lib.linux-x86_64-2.7/lxml
copying src/lxml/doctestcompare.py -> build/lib.linux-x86_64-2.7/lxml
copying src/lxml/builder.py -> build/lib.linux-x86_64-2.7/lxml
copying src/lxml/cssselect.py -> build/lib.linux-x86_64-2.7/lxml
copying src/lxml/sax.py -> build/lib.linux-x86_64-2.7/lxml
copying src/lxml/_elementpath.py -> build/lib.linux-x86_64-2.7/lxml
copying src/lxml/ElementInclude.py -> build/lib.linux-x86_64-2.7/lxml
copying src/lxml/__init__.py -> build/lib.linux-x86_64-2.7/lxml
copying src/lxml/usedoctest.py -> build/lib.linux-x86_64-2.7/lxml
creating build/lib.linux-x86_64-2.7/lxml/includes
copying src/lxml/includes/__init__.py -> build/lib.linux-x86_64-2.7/lxml/includes
creating build/lib.linux-x86_64-2.7/lxml/html
copying src/lxml/html/html5parser.py -> build/lib.linux-x86_64-2.7/lxml/html
copying src/lxml/html/ElementSoup.py -> build/lib.linux-x86_64-2.7/lxml/html
copying src/lxml/html/builder.py -> build/lib.linux-x86_64-2.7/lxml/html
copying src/lxml/html/clean.py -> build/lib.linux-x86_64-2.7/lxml/html
copying src/lxml/html/_diffcommand.py -> build/lib.linux-x86_64-2.7/lxml/html
copying src/lxml/html/diff.py -> build/lib.linux-x86_64-2.7/lxml/html
copying src/lxml/html/_html5builder.py -> build/lib.linux-x86_64-2.7/lxml/html
copying src/lxml/html/_setmixin.py -> build/lib.linux-x86_64-2.7/lxml/html
copying src/lxml/html/defs.py -> build/lib.linux-x86_64-2.7/lxml/html
copying src/lxml/html/formfill.py -> build/lib.linux-x86_64-2.7/lxml/html
copying src/lxml/html/soupparser.py -> build/lib.linux-x86_64-2.7/lxml/html
copying src/lxml/html/__init__.py -> build/lib.linux-x86_64-2.7/lxml/html
copying src/lxml/html/usedoctest.py -> build/lib.linux-x86_64-2.7/lxml/html
creating build/lib.linux-x86_64-2.7/lxml/isoschematron
copying src/lxml/isoschematron/__init__.py -> build/lib.linux-x86_64-2.7/lxml/isoschematron
copying src/lxml/lxml.etree.h -> build/lib.linux-x86_64-2.7/lxml
copying src/lxml/lxml.etree_api.h -> build/lib.linux-x86_64-2.7/lxml
copying src/lxml/includes/config.pxd -> build/lib.linux-x86_64-2.7/lxml/includes
copying src/lxml/includes/xpath.pxd -> build/lib.linux-x86_64-2.7/lxml/includes
copying src/lxml/includes/tree.pxd -> build/lib.linux-x86_64-2.7/lxml/includes
copying src/lxml/includes/dtdvalid.pxd -> build/lib.linux-x86_64-2.7/lxml/includes
copying src/lxml/includes/xmlparser.pxd -> build/lib.linux-x86_64-2.7/lxml/includes
copying src/lxml/includes/etreepublic.pxd -> build/lib.linux-x86_64-2.7/lxml/includes
copying src/lxml/includes/xslt.pxd -> build/lib.linux-x86_64-2.7/lxml/includes
copying src/lxml/includes/schematron.pxd -> build/lib.linux-x86_64-2.7/lxml/includes
copying src/lxml/includes/uri.pxd -> build/lib.linux-x86_64-2.7/lxml/includes
copying src/lxml/includes/c14n.pxd -> build/lib.linux-x86_64-2.7/lxml/includes
copying src/lxml/includes/xinclude.pxd -> build/lib.linux-x86_64-2.7/lxml/includes
copying src/lxml/includes/xmlschema.pxd -> build/lib.linux-x86_64-2.7/lxml/includes
copying src/lxml/includes/xmlerror.pxd -> build/lib.linux-x86_64-2.7/lxml/includes
copying src/lxml/includes/relaxng.pxd -> build/lib.linux-x86_64-2.7/lxml/includes
copying src/lxml/includes/htmlparser.pxd -> build/lib.linux-x86_64-2.7/lxml/includes
copying src/lxml/includes/etree_defs.h -> build/lib.linux-x86_64-2.7/lxml/includes
copying src/lxml/includes/lxml-version.h -> build/lib.linux-x86_64-2.7/lxml/includes
creating build/lib.linux-x86_64-2.7/lxml/isoschematron/resources
creating build/lib.linux-x86_64-2.7/lxml/isoschematron/resources/rng
copying src/lxml/isoschematron/resources/rng/iso-schematron.rng -> build/lib.linux-x86_64-2.7/lxml/isoschematron/resources/rng
creating build/lib.linux-x86_64-2.7/lxml/isoschematron/resources/xsl
copying src/lxml/isoschematron/resources/xsl/RNG2Schtrn.xsl -> build/lib.linux-x86_64-2.7/lxml/isoschematron/resources/xsl
copying src/lxml/isoschematron/resources/xsl/XSD2Schtrn.xsl -> build/lib.linux-x86_64-2.7/lxml/isoschematron/resources/xsl
creating build/lib.linux-x86_64-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_skeleton_for_xslt1.xsl -> build/lib.linux-x86_64-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_dsdl_include.xsl -> build/lib.linux-x86_64-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_message.xsl -> build/lib.linux-x86_64-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_svrl_for_xslt1.xsl -> build/lib.linux-x86_64-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_abstract_expand.xsl -> build/lib.linux-x86_64-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/readme.txt -> build/lib.linux-x86_64-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
running build_ext
building 'lxml.etree' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/src
creating build/temp.linux-x86_64-2.7/src/lxml
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/libxml2 -I/tmp/pip_build_root/lxml/src/lxml/includes -I/usr/include/python2.7 -c src/lxml/lxml.etree.c -o build/temp.linux-x86_64-2.7/src/lxml/lxml.etree.o -w
x86_64-linux-gnu-gcc: internal compiler error: Killed (program cc1)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.8/README.Bugs> for instructions.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 4
----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-KUq9VD-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_root/lxml
Storing debug log for failure in /root/.pip/pip.log
Also, the pip.log file looks like this,
status = self.run(options, args)
File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 283, in run
requirement_set.install(install_options, global_options, root=options.root_path)
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1435, in install
requirement.install(install_options, global_options, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 706, in install
cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False)
File "/usr/lib/python2.7/dist-packages/pip/util.py", line 697, in call_subprocess
% (command_desc, proc.returncode, cwd))
InstallationError: Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-KUq9VD-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_root/lxml
dmesg | tail command shows output like this,
[1744367.676147] Out of memory: Kill process 25518 (cc1) score 388 or sacrifice child
[1744367.676665] Killed process 25518 (cc1) total-vm:242352kB, anon-rss:200608kB, file-rss:0kB
It's seems like a memory issue. I am taking reference form this question
Possible solution (if you have no ability to increase memory on that machine) is to add swap file.
sudo dd if=/dev/zero of=/swapfile bs=1024 count=524288
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
from https://github.com/pydata/pandas/issues/1880#issuecomment-9920484
This worked for me on smallest digital ocean machine
In this particular case, it has nothing to do with dependencies, it's a memory problem.
I had this problem within a virtualbox VM. My solution was to increase memory allocated to the VM from the default 512Mb to 1024Mb.
Refer to https://stackoverflow.com/a/6504860/261718
Go install some dev packages before pip install lxml
apt-get install libxml2-dev libxslt1-dev python-dev
Using digitalocean smallest machine you can just turn off mysql and apache while compiling using
sudo service apache2 stop
sudo service mysql stop
and after installing lxml turn them on again using this commands with 'start' instead of 'stop'. Works pretty well for me without using swap file
If #Drake answer does not work for you try adding lib1g-dev.
$ sudo apt-get install -y libxml2-dev libxslt1-dev zlib1g-dev
I'm having some trouble installing psycopg2 into a virtualenv. Here is the output for pip install psycopg2.
Note 1: I checked a lot of StackOverflow answers and i installed all that *-dev packages suggested. Some hint here?
Note 2: I get same output from python setup.py install on source.
Downloading/unpacking psycopg2
Downloading psycopg2-2.5.1.tar.gz (684kB): 684kB downloaded
Running setup.py egg_info for package psycopg2
Installing collected packages: psycopg2
Running setup.py install for psycopg2
building 'psycopg2._psycopg' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.5.1 (dt dec pq3 ext)" -DPG_VERSION_HEX=0x09010A -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/usr/include/python2.7 -I. -I/usr/include/postgresql -I/usr/include/postgresql/9.1/server -c psycopg/psycopgmodule.c -o build/temp.linux-i686-2.7/psycopg/psycopgmodule.o -Wdeclaration-after-statement
In file included from /usr/include/string.h:642:0,
from /usr/include/python2.7/Python.h:38,
from ./psycopg/psycopg.h:30,
from psycopg/psycopgmodule.c:27:
/usr/include/i386-linux-gnu/bits/string3.h: In function ‘memcpy’:
/usr/include/i386-linux-gnu/bits/string3.h:52:3: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.6/README.Bugs> for instructions.
Preprocessed source stored into /tmp/ccANjg96.out file, please attach this to your bugreport.
error: command 'gcc' failed with exit status 1
Complete output from command /webapps/sysacad_wrapper/bin/python -c "import setuptools;__file__='/webapps/sysacad_wrapper/build/psycopg2/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-Ixowrn-record/install-record.txt --single-version-externally-managed --install-headers /webapps/sysacad_wrapper/include/site/python2.7:
running install
running build
running build_py
creating build
creating build/lib.linux-i686-2.7
creating build/lib.linux-i686-2.7/psycopg2
copying lib/tz.py -> build/lib.linux-i686-2.7/psycopg2
copying lib/psycopg1.py -> build/lib.linux-i686-2.7/psycopg2
copying lib/_json.py -> build/lib.linux-i686-2.7/psycopg2
copying lib/extras.py -> build/lib.linux-i686-2.7/psycopg2
copying lib/extensions.py -> build/lib.linux-i686-2.7/psycopg2
copying lib/pool.py -> build/lib.linux-i686-2.7/psycopg2
copying lib/errorcodes.py -> build/lib.linux-i686-2.7/psycopg2
copying lib/_range.py -> build/lib.linux-i686-2.7/psycopg2
copying lib/__init__.py -> build/lib.linux-i686-2.7/psycopg2
creating build/lib.linux-i686-2.7/psycopg2/tests
copying tests/test_module.py -> build/lib.linux-i686-2.7/psycopg2/tests
copying tests/test_types_extras.py -> build/lib.linux-i686-2.7/psycopg2/tests
copying tests/test_lobject.py -> build/lib.linux-i686-2.7/psycopg2/tests
copying tests/test_copy.py -> build/lib.linux-i686-2.7/psycopg2/tests
copying tests/test_with.py -> build/lib.linux-i686-2.7/psycopg2/tests
copying tests/test_cancel.py -> build/lib.linux-i686-2.7/psycopg2/tests
copying tests/test_connection.py -> build/lib.linux-i686-2.7/psycopg2/tests
copying tests/test_quote.py -> build/lib.linux-i686-2.7/psycopg2/tests
copying tests/dbapi20.py -> build/lib.linux-i686-2.7/psycopg2/tests
copying tests/testconfig.py -> build/lib.linux-i686-2.7/psycopg2/tests
copying tests/test_bugX000.py -> build/lib.linux-i686-2.7/psycopg2/tests
copying tests/test_extras_dictcursor.py -> build/lib.linux-i686-2.7/psycopg2/tests
copying tests/testutils.py -> build/lib.linux-i686-2.7/psycopg2/tests
copying tests/test_transaction.py -> build/lib.linux-i686-2.7/psycopg2/tests
copying tests/test_bug_gc.py -> build/lib.linux-i686-2.7/psycopg2/tests
copying tests/test_dates.py -> build/lib.linux-i686-2.7/psycopg2/tests
copying tests/test_async.py -> build/lib.linux-i686-2.7/psycopg2/tests
copying tests/dbapi20_tpc.py -> build/lib.linux-i686-2.7/psycopg2/tests
copying tests/test_notify.py -> build/lib.linux-i686-2.7/psycopg2/tests
copying tests/test_green.py -> build/lib.linux-i686-2.7/psycopg2/tests
copying tests/test_types_basic.py -> build/lib.linux-i686-2.7/psycopg2/tests
copying tests/test_psycopg2_dbapi20.py -> build/lib.linux-i686-2.7/psycopg2/tests
copying tests/test_cursor.py -> build/lib.linux-i686-2.7/psycopg2/tests
copying tests/__init__.py -> build/lib.linux-i686-2.7/psycopg2/tests
running build_ext
building 'psycopg2._psycopg' extension
creating build/temp.linux-i686-2.7
creating build/temp.linux-i686-2.7/psycopg
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.5.1 (dt dec pq3 ext)" -DPG_VERSION_HEX=0x09010A -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/usr/include/python2.7 -I. -I/usr/include/postgresql -I/usr/include/postgresql/9.1/server -c psycopg/psycopgmodule.c -o build/temp.linux-i686-2.7/psycopg/psycopgmodule.o -Wdeclaration-after-statement
In file included from /usr/include/string.h:642:0,
from /usr/include/python2.7/Python.h:38,
from ./psycopg/psycopg.h:30,
from psycopg/psycopgmodule.c:27:
/usr/include/i386-linux-gnu/bits/string3.h: In function ‘memcpy’:
/usr/include/i386-linux-gnu/bits/string3.h:52:3: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.6/README.Bugs> for instructions.
Preprocessed source stored into /tmp/ccANjg96.out file, please attach this to your bugreport.
error: command 'gcc' failed with exit status 1
----------------------------------------
Cleaning up...
Command /webapps/sysacad_wrapper/bin/python -c "import setuptools;__file__='/webapps/sysacad_wrapper/build/psycopg2/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-Ixowrn-record/install-record.txt --single-version-externally-managed --install-headers /webapps/sysacad_wrapper/include/site/python2.7 failed with error code 1 in /webapps/sysacad_wrapper/build/psycopg2
Traceback (most recent call last):
File "/webapps/sysacad_wrapper/bin/pip", line 9, in <module>
load_entry_point('pip==1.4.1', 'console_scripts', 'pip')()
File "/webapps/sysacad_wrapper/local/lib/python2.7/site-packages/pip/__init__.py", line 148, in main
return command.main(args[1:], options)
File "/webapps/sysacad_wrapper/local/lib/python2.7/site-packages/pip/basecommand.py", line 169, in main
text = '\n'.join(complete_log)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 60: ordinal not in range(128)
I've already solved it. Upgrading gcc to 4.8.2 did the work. Thanks anyway.