[Python] Installare un package via pip sotto la versione 3.4

Marco Ippolito ippolito.marco a gmail.com
Mer 21 Gen 2015 10:14:40 CET


Ciao a tutti,
sto provando ad installare un pacchetto via pip solo per python3.4
(funziona solo con 3.4).

ma continuo ad avere problemi di installazione.

Vi riporto il log dell'installazione (scusate per la lunghezza):
marco a pc:~/crawlscrape$ sudo python3.4 -m pip install GoogleScraper
The directory '/home/marco/.cache/pip/log' or its parent directory is
not owned by the current user and the debug log has been disabled.
Please check the permissions and owner of that directory. If executing
pip with sudo, you may want the -H flag.
The directory '/home/marco/.cache/pip/http' or its parent directory is
not owned by the current user and the cache has been disabled. Please
check the permissions and owner of that directory. If executing pip
with sudo, you may want the -H flag.
The directory '/home/marco/.cache/pip/http' or its parent directory is
not owned by the current user and the cache has been disabled. Please
check the permissions and owner of that directory. If executing pip
with sudo, you may want the -H flag.
Collecting GoogleScraper
  Downloading GoogleScraper-0.1.18.tar.gz (67kB)
    100% |################################| 69kB 655kB/s
Collecting lxml (from GoogleScraper)
  Downloading lxml-3.4.1.tar.gz (3.5MB)
    100% |################################| 3.5MB 3.4MB/s
    Building lxml version 3.4.1.
    Building without Cython.
    Using build configuration of libxslt 1.1.28
    /usr/lib/python3.4/distutils/dist.py:260: UserWarning: Unknown
distribution option: 'bugtrack_url'
      warnings.warn(msg)
Requirement already satisfied (use --upgrade to upgrade): selenium in
/usr/local/lib/python3.4/dist-packages (from GoogleScraper)
Requirement already satisfied (use --upgrade to upgrade): cssselect in
/usr/local/lib/python3.4/dist-packages (from GoogleScraper)
Requirement already satisfied (use --upgrade to upgrade): requests in
/usr/local/lib/python3.4/dist-packages (from GoogleScraper)
Requirement already satisfied (use --upgrade to upgrade): PyMySql in
/usr/local/lib/python3.4/dist-packages (from GoogleScraper)
Requirement already satisfied (use --upgrade to upgrade): sqlalchemy
in /usr/local/lib/python3.4/dist-packages (from GoogleScraper)
Installing collected packages: lxml, GoogleScraper
  Running setup.py install for lxml
    Building lxml version 3.4.1.
    Building without Cython.
    Using build configuration of libxslt 1.1.28
    building 'lxml.etree' extension
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall
-Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4
-Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC
-I/usr/include/libxml2
-I/tmp/pip-build-66cehrii/lxml/src/lxml/includes
-I/usr/include/python3.4m -c src/lxml/lxml.etree.c -o
build/temp.linux-x86_64-3.4/src/lxml/lxml.etree.o -w
    src/lxml/lxml.etree.c:8:22: fatal error: pyconfig.h: File o
directory non esistente
     #include "pyconfig.h"
                          ^
    compilation terminated.
    /usr/lib/python3.4/distutils/dist.py:260: UserWarning: Unknown
distribution option: 'bugtrack_url'
      warnings.warn(msg)
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    Complete output from command /usr/bin/python3.4 -c "import
setuptools, tokenize;__file__='/tmp/pip-build-66cehrii/lxml/setup.py';exec(compile(getattr(tokenize,
'open', open)(__file__).read().replace('\r\n', '\n'), __file__,
'exec'))" install --record /tmp/pip-c9onfvw7-record/install-record.txt
--single-version-externally-managed --compile:
    Building lxml version 3.4.1.

    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-3.4

    creating build/lib.linux-x86_64-3.4/lxml

    copying src/lxml/_elementpath.py -> build/lib.linux-x86_64-3.4/lxml

    copying src/lxml/usedoctest.py -> build/lib.linux-x86_64-3.4/lxml

    copying src/lxml/sax.py -> build/lib.linux-x86_64-3.4/lxml

    copying src/lxml/builder.py -> build/lib.linux-x86_64-3.4/lxml

    copying src/lxml/ElementInclude.py -> build/lib.linux-x86_64-3.4/lxml

    copying src/lxml/__init__.py -> build/lib.linux-x86_64-3.4/lxml

    copying src/lxml/pyclasslookup.py -> build/lib.linux-x86_64-3.4/lxml

    copying src/lxml/cssselect.py -> build/lib.linux-x86_64-3.4/lxml

    copying src/lxml/doctestcompare.py -> build/lib.linux-x86_64-3.4/lxml

    creating build/lib.linux-x86_64-3.4/lxml/includes

    copying src/lxml/includes/__init__.py ->
build/lib.linux-x86_64-3.4/lxml/includes

    creating build/lib.linux-x86_64-3.4/lxml/html

    copying src/lxml/html/usedoctest.py -> build/lib.linux-x86_64-3.4/lxml/html

    copying src/lxml/html/_setmixin.py -> build/lib.linux-x86_64-3.4/lxml/html

    copying src/lxml/html/soupparser.py -> build/lib.linux-x86_64-3.4/lxml/html

    copying src/lxml/html/ElementSoup.py -> build/lib.linux-x86_64-3.4/lxml/html

    copying src/lxml/html/_diffcommand.py ->
build/lib.linux-x86_64-3.4/lxml/html

    copying src/lxml/html/html5parser.py -> build/lib.linux-x86_64-3.4/lxml/html

    copying src/lxml/html/builder.py -> build/lib.linux-x86_64-3.4/lxml/html

    copying src/lxml/html/defs.py -> build/lib.linux-x86_64-3.4/lxml/html

    copying src/lxml/html/formfill.py -> build/lib.linux-x86_64-3.4/lxml/html

    copying src/lxml/html/__init__.py -> build/lib.linux-x86_64-3.4/lxml/html

    copying src/lxml/html/_html5builder.py ->
build/lib.linux-x86_64-3.4/lxml/html

    copying src/lxml/html/diff.py -> build/lib.linux-x86_64-3.4/lxml/html

    copying src/lxml/html/clean.py -> build/lib.linux-x86_64-3.4/lxml/html

    creating build/lib.linux-x86_64-3.4/lxml/isoschematron

    copying src/lxml/isoschematron/__init__.py ->
build/lib.linux-x86_64-3.4/lxml/isoschematron

    copying src/lxml/lxml.etree.h -> build/lib.linux-x86_64-3.4/lxml

    copying src/lxml/lxml.etree_api.h -> build/lib.linux-x86_64-3.4/lxml

    copying src/lxml/includes/uri.pxd ->
build/lib.linux-x86_64-3.4/lxml/includes

    copying src/lxml/includes/xmlparser.pxd ->
build/lib.linux-x86_64-3.4/lxml/includes

    copying src/lxml/includes/xpath.pxd ->
build/lib.linux-x86_64-3.4/lxml/includes

    copying src/lxml/includes/relaxng.pxd ->
build/lib.linux-x86_64-3.4/lxml/includes

    copying src/lxml/includes/xinclude.pxd ->
build/lib.linux-x86_64-3.4/lxml/includes

    copying src/lxml/includes/config.pxd ->
build/lib.linux-x86_64-3.4/lxml/includes

    copying src/lxml/includes/htmlparser.pxd ->
build/lib.linux-x86_64-3.4/lxml/includes

    copying src/lxml/includes/dtdvalid.pxd ->
build/lib.linux-x86_64-3.4/lxml/includes

    copying src/lxml/includes/schematron.pxd ->
build/lib.linux-x86_64-3.4/lxml/includes

    copying src/lxml/includes/tree.pxd ->
build/lib.linux-x86_64-3.4/lxml/includes

    copying src/lxml/includes/c14n.pxd ->
build/lib.linux-x86_64-3.4/lxml/includes

    copying src/lxml/includes/etreepublic.pxd ->
build/lib.linux-x86_64-3.4/lxml/includes

    copying src/lxml/includes/xslt.pxd ->
build/lib.linux-x86_64-3.4/lxml/includes

    copying src/lxml/includes/xmlerror.pxd ->
build/lib.linux-x86_64-3.4/lxml/includes

    copying src/lxml/includes/xmlschema.pxd ->
build/lib.linux-x86_64-3.4/lxml/includes

    copying src/lxml/includes/lxml-version.h ->
build/lib.linux-x86_64-3.4/lxml/includes

    copying src/lxml/includes/etree_defs.h ->
build/lib.linux-x86_64-3.4/lxml/includes

    creating build/lib.linux-x86_64-3.4/lxml/isoschematron/resources

    creating build/lib.linux-x86_64-3.4/lxml/isoschematron/resources/rng

    copying src/lxml/isoschematron/resources/rng/iso-schematron.rng ->
build/lib.linux-x86_64-3.4/lxml/isoschematron/resources/rng

    creating build/lib.linux-x86_64-3.4/lxml/isoschematron/resources/xsl

    copying src/lxml/isoschematron/resources/xsl/RNG2Schtrn.xsl ->
build/lib.linux-x86_64-3.4/lxml/isoschematron/resources/xsl

    copying src/lxml/isoschematron/resources/xsl/XSD2Schtrn.xsl ->
build/lib.linux-x86_64-3.4/lxml/isoschematron/resources/xsl

    creating build/lib.linux-x86_64-3.4/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-3.4/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-3.4/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-3.4/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-3.4/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-3.4/lxml/isoschematron/resources/xsl/iso-schematron-xslt1

    copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/readme.txt
-> build/lib.linux-x86_64-3.4/lxml/isoschematron/resources/xsl/iso-schematron-xslt1

    running build_ext

    building 'lxml.etree' extension

    creating build/temp.linux-x86_64-3.4

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

    creating build/temp.linux-x86_64-3.4/src/lxml

    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall
-Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4
-Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC
-I/usr/include/libxml2
-I/tmp/pip-build-66cehrii/lxml/src/lxml/includes
-I/usr/include/python3.4m -c src/lxml/lxml.etree.c -o
build/temp.linux-x86_64-3.4/src/lxml/lxml.etree.o -w

    src/lxml/lxml.etree.c:8:22: fatal error: pyconfig.h: File o
directory non esistente

     #include "pyconfig.h"

                          ^

    compilation terminated.

    /usr/lib/python3.4/distutils/dist.py:260: UserWarning: Unknown
distribution option: 'bugtrack_url'

      warnings.warn(msg)

    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

    ----------------------------------------
    Command "/usr/bin/python3.4 -c "import setuptools,
tokenize;__file__='/tmp/pip-build-66cehrii/lxml/setup.py';exec(compile(getattr(tokenize,
'open', open)(__file__).read().replace('\r\n', '\n'), __file__,
'exec'))" install --record /tmp/pip-c9onfvw7-record/install-record.txt
--single-version-externally-managed --compile" failed with error code
1 in /tmp/pip-build-66cehrii/lxml

Che devo fare?

Marco


Maggiori informazioni sulla lista Python