IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Python Discussion :

installation de pyschopg2 sous python3.7


Sujet :

Python

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre éclairé Avatar de Bayard
    Inscrit en
    Juin 2002
    Messages
    863
    Détails du profil
    Informations forums :
    Inscription : Juin 2002
    Messages : 863
    Par défaut installation de pyschopg2 sous python3.7
    Bonjour

    Lorsque j'installe pyschopg2 sous python3.7 (je suis sous Ubuntu 19.10), j'ai l'erreur:
    pip install psycopg2
    Collecting psycopg2
    Using cached https://files.pythonhosted.org/packa...2-2.8.4.tar.gz
    ERROR: Command errored out with exit status 1:
    command: /home/kevin/.local/share/virtualenvs/bumpmanager-omXPzsXs/bin/python3.7m -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-3jk6dso_/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-3jk6dso_/psycopg2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-3jk6dso_/psycopg2/pip-egg-info
    cwd: /tmp/pip-install-3jk6dso_/psycopg2/
    Complete output (23 lines):
    running egg_info
    creating /tmp/pip-install-3jk6dso_/psycopg2/pip-egg-info/psycopg2.egg-info
    writing /tmp/pip-install-3jk6dso_/psycopg2/pip-egg-info/psycopg2.egg-info/PKG-INFO
    writing dependency_links to /tmp/pip-install-3jk6dso_/psycopg2/pip-egg-info/psycopg2.egg-info/dependency_links.txt
    writing top-level names to /tmp/pip-install-3jk6dso_/psycopg2/pip-egg-info/psycopg2.egg-info/top_level.txt
    writing manifest file '/tmp/pip-install-3jk6dso_/psycopg2/pip-egg-info/psycopg2.egg-info/SOURCES.txt'

    Error: pg_config executable not found.

    pg_config is required to build psycopg2 from source. Please add the directory
    containing pg_config to the $PATH or specify the full executable path with the
    option:

    python setup.py build_ext --pg-config /path/to/pg_config build ...

    or with the pg_config option in 'setup.cfg'.

    If you prefer to avoid building psycopg2 from source, please install the PyPI
    'psycopg2-binary' package instead.

    For further information please check the 'doc/src/install.rst' file (also at
    <http://initd.org/psycopg/docs/install.html>).

    ----------------------------------------
    ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
    J'ai tenté d'installer psycopg2-binary, mais là, j'ai

    Collecting psycopg2==2.8.4
    Downloading https://pypi-proxy.company.com/root/...2-2.8.4.tar.gz (377kB)
    Building wheels for collected packages: psycopg2
    Building wheel for psycopg2 (setup.py): started
    Building wheel for psycopg2 (setup.py): finished with status 'error'
    Running setup.py clean for psycopg2
    Failed to build psycopg2
    Installing collected packages: psycopg2
    Running setup.py install for psycopg2: started
    Running setup.py install for psycopg2: finished with status 'error'

    ERROR: Command errored out with exit status 1:
    command: /home/kevin/.local/share/virtualenvs/appli-omXPzsXs/bin/python3.7m -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-e2tkaw3f/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-e2tkaw3f/psycopg2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-iex2si6d --python-tag cp37
    cwd: /tmp/pip-install-e2tkaw3f/psycopg2/
    Complete output (42 lines):
    running bdist_wheel
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.7
    creating build/lib.linux-x86_64-3.7/psycopg2
    copying lib/_lru_cache.py -> build/lib.linux-x86_64-3.7/psycopg2
    copying lib/errors.py -> build/lib.linux-x86_64-3.7/psycopg2
    copying lib/extensions.py -> build/lib.linux-x86_64-3.7/psycopg2
    copying lib/_json.py -> build/lib.linux-x86_64-3.7/psycopg2
    copying lib/sql.py -> build/lib.linux-x86_64-3.7/psycopg2
    copying lib/compat.py -> build/lib.linux-x86_64-3.7/psycopg2
    copying lib/tz.py -> build/lib.linux-x86_64-3.7/psycopg2
    copying lib/pool.py -> build/lib.linux-x86_64-3.7/psycopg2
    copying lib/_ipaddress.py -> build/lib.linux-x86_64-3.7/psycopg2
    copying lib/_range.py -> build/lib.linux-x86_64-3.7/psycopg2
    copying lib/__init__.py -> build/lib.linux-x86_64-3.7/psycopg2
    copying lib/extras.py -> build/lib.linux-x86_64-3.7/psycopg2
    copying lib/errorcodes.py -> build/lib.linux-x86_64-3.7/psycopg2
    warning: build_py: byte-compiling is disabled, skipping.

    running build_ext
    building 'psycopg2._psycopg' extension
    creating build/temp.linux-x86_64-3.7
    creating build/temp.linux-x86_64-3.7/psycopg
    x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPSYCOPG_VERSION=2.8.4 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=110005 -DHAVE_LO64=1 -I/usr/include/python3.7m -I/home/kevin/.local/share/virtualenvs/appli-omXPzsXs/include/python3.7m -I. -I/usr/include/postgresql -I/usr/include/postgresql/11/server -c psycopg/psycopgmodule.c -o build/temp.linux-x86_64-3.7/psycopg/psycopgmodule.o -Wdeclaration-after-statement
    In file included from psycopg/psycopgmodule.c:27:
    ./psycopg/psycopg.h:34:10: fatal error: Python.h: Aucun fichier ou dossier de ce type
    34 | #include <Python.h>
    | ^~~~~~~~~~
    compilation terminated.

    It appears you are missing some prerequisite to build the package from source.

    You may install a binary package by installing 'psycopg2-binary' from PyPI.
    If you want to install psycopg2 from source, please install the packages
    required for the build and try again.

    For further information please check the 'doc/src/install.rst' file (also at
    <http://initd.org/psycopg/docs/install.html>).

    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    ----------------------------------------
    ERROR: Failed building wheel for psycopg2
    ERROR: Command errored out with exit status 1:
    command: /home/kevin/.local/share/virtualenvs/appli-omXPzsXs/bin/python3.7m -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-e2tkaw3f/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-e2tkaw3f/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-record-6in9gu81/install-record.txt --single-version-externally-managed --compile --install-headers /home/kevin/.local/share/virtualenvs/appli-omXPzsXs/include/site/python3.7/psycopg2
    cwd: /tmp/pip-install-e2tkaw3f/psycopg2/
    Complete output (42 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.7
    creating build/lib.linux-x86_64-3.7/psycopg2
    copying lib/_lru_cache.py -> build/lib.linux-x86_64-3.7/psycopg2
    copying lib/errors.py -> build/lib.linux-x86_64-3.7/psycopg2
    copying lib/extensions.py -> build/lib.linux-x86_64-3.7/psycopg2
    copying lib/_json.py -> build/lib.linux-x86_64-3.7/psycopg2
    copying lib/sql.py -> build/lib.linux-x86_64-3.7/psycopg2
    copying lib/compat.py -> build/lib.linux-x86_64-3.7/psycopg2
    copying lib/tz.py -> build/lib.linux-x86_64-3.7/psycopg2
    copying lib/pool.py -> build/lib.linux-x86_64-3.7/psycopg2
    copying lib/_ipaddress.py -> build/lib.linux-x86_64-3.7/psycopg2
    copying lib/_range.py -> build/lib.linux-x86_64-3.7/psycopg2
    copying lib/__init__.py -> build/lib.linux-x86_64-3.7/psycopg2
    copying lib/extras.py -> build/lib.linux-x86_64-3.7/psycopg2
    copying lib/errorcodes.py -> build/lib.linux-x86_64-3.7/psycopg2
    warning: build_py: byte-compiling is disabled, skipping.

    running build_ext
    building 'psycopg2._psycopg' extension
    creating build/temp.linux-x86_64-3.7
    creating build/temp.linux-x86_64-3.7/psycopg
    x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPSYCOPG_VERSION=2.8.4 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=110005 -DHAVE_LO64=1 -I/usr/include/python3.7m -I/home/kevin/.local/share/virtualenvs/appli-omXPzsXs/include/python3.7m -I. -I/usr/include/postgresql -I/usr/include/postgresql/11/server -c psycopg/psycopgmodule.c -o build/temp.linux-x86_64-3.7/psycopg/psycopgmodule.o -Wdeclaration-after-statement
    In file included from psycopg/psycopgmodule.c:27:
    ./psycopg/psycopg.h:34:10: fatal error: Python.h: Aucun fichier ou dossier de ce type
    34 | #include <Python.h>
    | ^~~~~~~~~~
    compilation terminated.

    It appears you are missing some prerequisite to build the package from source.

    You may install a binary package by installing 'psycopg2-binary' from PyPI.
    If you want to install psycopg2 from source, please install the packages
    required for the build and try again.

    For further information please check the 'doc/src/install.rst' file (also at
    <http://initd.org/psycopg/docs/install.html>).

    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    ----------------------------------------
    ERROR: Command errored out with exit status 1: /home/kevin/.local/share/virtualenvs/appli-omXPzsXs/bin/python3.7m -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-e2tkaw3f/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-e2tkaw3f/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-record-6in9gu81/install-record.txt --single-version-externally-managed --compile --install-headers /home/kevin/.local/share/virtualenvs/appli-omXPzsXs/include/site/python3.7/psycopg2 Check the logs for full command output.
    Est-ce que quelqu'un a déjà installé psychopg2 sous python3.7 ?


    Cordialement

  2. #2
    Membre éclairé Avatar de Bayard
    Inscrit en
    Juin 2002
    Messages
    863
    Détails du profil
    Informations forums :
    Inscription : Juin 2002
    Messages : 863
    Par défaut
    Il suffisait de faire sudo apt install python3.7-dev

  3. #3
    Expert confirmé

    Homme Profil pro
    Inscrit en
    Octobre 2008
    Messages
    4 307
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Belgique

    Informations forums :
    Inscription : Octobre 2008
    Messages : 4 307
    Par défaut
    Salut,
    ./psycopg/psycopg.h:34:10: fatal error: Python.h: Aucun fichier ou dossier de ce type
    Signifie simplement que tu n'as pas installé les fichiers de développement de Python.

    Installe-les avec ton système, pas avec pip.

    Pour Debian et dérivés c'est sudo apt-get install python3-dev pour yum, dns ou autres tu devrais pouvoir trouver.

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. installer Pmw sous python3
    Par zejmj dans le forum Tkinter
    Réponses: 2
    Dernier message: 26/02/2012, 18h24
  2. [Kylix] Installer Kylix 3 sous Slackware 9.1
    Par Hidekii dans le forum EDI
    Réponses: 1
    Dernier message: 02/06/2004, 14h51
  3. installation de postgreql sous windows
    Par titimaïna dans le forum Installation
    Réponses: 7
    Dernier message: 01/01/2004, 18h26
  4. [PostgreSQL/CYGWIN] install de postgres sous WINdows
    Par loicmillion dans le forum Administration
    Réponses: 2
    Dernier message: 16/04/2003, 11h37
  5. Réponses: 2
    Dernier message: 23/02/2003, 17h26

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo