pipenv error : pipenv.patched.notpip._internal.exceptions.InstallationError

Voici une erreur que j’ai eu en essayant de changer un fichier requirements.txt à Pipfile :

$ pipenv install
requirements.txt found, instead of Pipfile! Converting…
Warning: Your Pipfile now contains pinned versions, if your requirements.txt did. 
We recommend updating your Pipfile to specify the "*" version, instead.
Pipfile.lock not found, creating…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
/home/aymeric/.local/lib/python2.7/site-packages/pipenv/patched/piptools/repositories/pypi.py", line 297, in resolve_reqs
    results = resolver._resolve_one(reqset, ireq)
  File "/home/aymeric/.local/lib/python2.7/site-packages/pipenv/patched/notpip/_internal/resolve.py", line 263, in _resolve_one
    abstract_dist = self._get_abstract_dist_for(req_to_install)
  File "/home/aymeric/.local/lib/python2.7/site-packages/pipenv/patched/notpip/_internal/resolve.py", line 213, in _get_abstract_dist_for
    self.require_hashes
  File "/home/aymeric/.local/lib/python2.7/site-packages/pipenv/patched/notpip/_internal/operations/prepare.py", line 294, in prepare_linked_requirement
    abstract_dist.prep_for_dist(finder, self.build_isolation)
  File "/home/aymeric/.local/lib/python2.7/site-packages/pipenv/patched/notpip/_internal/operations/prepare.py", line 127, in prep_for_dist
    self.req.run_egg_info()
  File "/home/aymeric/.local/lib/python2.7/site-packages/pipenv/patched/notpip/_internal/req/req_install.py", line 636, in run_egg_info
    command_desc='python setup.py egg_info')
  File "/home/aymeric/.local/lib/python2.7/site-packages/pipenv/patched/notpip/_internal/utils/misc.py", line 701, in call_subprocess
    % (command_desc, proc.returncode, cwd))
pipenv.patched.notpip._internal.exceptions.InstallationError: Command "python setup.py egg_info" failed with error code 1 in /tmp/tmpRetojUbuild/pygraphviz/
/home/aymeric/.local/lib/python2.7/site-packages/pipenv/_compat.py:113: ResourceWarning: Implicitly cleaning up <TemporaryDirectory '/tmp/pipenv-JHAA9B-requirements'>
  warnings.warn(warn_message, ResourceWarning)
 
/home/aymeric/.local/lib/python2.7/site-packages/pipenv/vendor/vistir/compat.py:109: ResourceWarning: Implicitly cleaning up <TemporaryDirectory '/tmp/pipenv-ynbhs9-requirements'>
  warnings.warn(warn_message, ResourceWarning)

Pas très compréhensible.
C’est qu’a priori, l’une des dépendances ne s’est pas correctement installée.

Une première solution pour comprendre cette erreur est d’utiliser le mode verbose de pipenv

$ pipenv -v install
Pipfile.lock not found, creating…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
... beaucoup de lignes ...
 
  pygraphviz==1.2 not in cache, need to check index
 
Traceback (most recent call last):
  File "/home/aymeric/.local/lib/python2.7/site-packages/pipenv/resolver.py", line 101, in <module>
    main()
  File "/home/aymeric/.local/lib/python2.7/site-packages/pipenv/resolver.py", line 90, in main
    system=system,
  File "/home/aymeric/.local/lib/python2.7/site-packages/pipenv/resolver.py", line 73, in resolve
    allow_global=system,
  File "/home/aymeric/.local/lib/python2.7/site-packages/pipenv/utils.py", line 422, in resolve_deps
    req_dir=req_dir,
  File "/home/aymeric/.local/lib/python2.7/site-packages/pipenv/utils.py", line 302, in actually_resolve_deps
    results = resolver.resolve(max_rounds=environments.PIPENV_MAX_ROUNDS)
  File "/home/aymeric/.local/lib/python2.7/site-packages/pipenv/patched/piptools/resolver.py", line 102, in resolve
    has_changed, best_matches = self._resolve_one_round()
  File "/home/aymeric/.local/lib/python2.7/site-packages/pipenv/patched/piptools/resolver.py", line 206, in _resolve_one_round
    for dep in self._iter_dependencies(best_match):
  File "/home/aymeric/.local/lib/python2.7/site-packages/pipenv/patched/piptools/resolver.py", line 301, in _iter_dependencies
    dependencies = self.repository.get_dependencies(ireq)
  File "/home/aymeric/.local/lib/python2.7/site-packages/pipenv/patched/piptools/repositories/pypi.py", line 235, in get_dependencies
    legacy_results = self.get_legacy_dependencies(ireq)
  File "/home/aymeric/.local/lib/python2.7/site-packages/pipenv/patched/piptools/repositories/pypi.py", line 415, in get_legacy_dependencies
    results, ireq = self.resolve_reqs(download_dir, ireq, wheel_cache)
  File "/home/aymeric/.local/lib/python2.7/site-packages/pipenv/patched/piptools/repositories/pypi.py", line 297, in resolve_reqs
    results = resolver._resolve_one(reqset, ireq)
  File "/home/aymeric/.local/lib/python2.7/site-packages/pipenv/patched/notpip/_internal/resolve.py", line 263, in _resolve_one
    abstract_dist = self._get_abstract_dist_for(req_to_install)
  File "/home/aymeric/.local/lib/python2.7/site-packages/pipenv/patched/notpip/_internal/resolve.py", line 213, in _get_abstract_dist_for
    self.require_hashes
  File "/home/aymeric/.local/lib/python2.7/site-packages/pipenv/patched/notpip/_internal/operations/prepare.py", line 294, in prepare_linked_requirement
    abstract_dist.prep_for_dist(finder, self.build_isolation)
  File "/home/aymeric/.local/lib/python2.7/site-packages/pipenv/patched/notpip/_internal/operations/prepare.py", line 127, in prep_for_dist
    self.req.run_egg_info()
  File "/home/aymeric/.local/lib/python2.7/site-packages/pipenv/patched/notpip/_internal/req/req_install.py", line 636, in run_egg_info
    command_desc='python setup.py egg_info')
  File "/home/aymeric/.local/lib/python2.7/site-packages/pipenv/patched/notpip/_internal/utils/misc.py", line 701, in call_subprocess
    % (command_desc, proc.returncode, cwd))
pipenv.patched.notpip._internal.exceptions.InstallationError: Command "python setup.py egg_info" failed with error code 1 in /tmp/tmpJrXSGabuild/pygraphviz/
/home/aymeric/.local/lib/python2.7/site-packages/pipenv/_compat.py:113: ResourceWarning: Implicitly cleaning up <TemporaryDirectory '/tmp/pipenv-uFuoGa-requirements'>
  warnings.warn(warn_message, ResourceWarning)
 
/home/aymeric/.local/lib/python2.7/site-packages/pipenv/vendor/vistir/compat.py:109: ResourceWarning: Implicitly cleaning up <TemporaryDirectory '/tmp/pipenv-n54Qsv-requirements'>
  warnings.warn(warn_message, ResourceWarning)

C’est donc au moment de l’installation de pygraphviz que ça plante !

Pour connaitre exactement l’erreur, le plus simple est d’essayer d’installer via la commande `pipenv install pygraphviz==1.2`.

$ pipenv install pygraphviz==1.2 
Installing pygraphviz==1.2…
Collecting pygraphviz==1.2
  Using cached https://files.pythonhosted.org/packages/5f/a1/fdfad11aba3af0ba7308ff98702fe7e87d81c48624cad65aa67862eff23f/pygraphviz-1.2.tar.gz
    Complete output from command python setup.py egg_info:
    Package libcgraph was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libcgraph.pc'
    to the PKG_CONFIG_PATH environment variable
    Package 'libcgraph', required by 'virtual:world', not found
    Package libcgraph was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libcgraph.pc'
    to the PKG_CONFIG_PATH environment variable
    Package 'libcgraph', required by 'virtual:world', not found
    Trying pkg-config
    Trying dotneato-config
    Failed to find dotneato-config
 
    Your Graphviz installation could not be found.
 
    1) You don't have Graphviz installed:
       Install Graphviz (http://graphviz.org)
 
    2) Your Graphviz package might incomplete.
       Install the binary development subpackage (e.g. libgraphviz-dev or similar.)
 
    3) You are using Windows
       There are no PyGraphviz binary packages for Windows but you might be
       able to build it from this source.  See
       http://networkx.lanl.gov/pygraphviz/reference/faq.html
 
... beaucoup de ligne ...

L’erreur est assez clair, je n’ai pas Graphviz sur mon système. Il me reste qu’à l’installer.

À noter que dans mon cas, c’était la version 1.2 de pygraphviz qui devait être installée, les versions plus récente ne donnent pas d’erreur aussi précise.
Parfois donc (et peut-être dans votre cas) la lib qui vous posera problème ne sera peut-être pas aussi précise dans l’erreur qu’elle indique.

Bonne chance

Aymeric DERBOIS

J'ai 27 ans et je suis développeur. Je travail la plupart du temps sur des techno web, mais pas que. Étant à l'affût des nouveautés, j'adore découvrir tout et n'importe quoi dans l'informatique. Je suis amoureux de CakePHP et j'utilise au quotidien Django. Je suis très ouvert d'esprit :). J'aime bien utiliser AngularJS aussi de temps à autre pour faire du front. Au quotidien j'utilise Fedora/Ubuntu pour le desktop et CentOS pour mes serveurs. Par ailleurs je maîtrise le C/C++/Python/PHP/...

More Posts - Website

Follow Me:
Twitter

Laisser un commentaire

Ce site utilise Akismet pour réduire les indésirables. En savoir plus sur comment les données de vos commentaires sont utilisées.