简体   繁体   中英

Python 3 Matplotlib installation failure on FreeBSD resulting in "legacy-install-failure"

We are working with a python 3.7 installation on FreeBSD and are trying to install MatPlotLib. When running python3 -m pip install matplotlib we received the below messages along with the output and the process failed.

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> matplotlib

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

Further up the response, the following block appeared:

note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for matplotlib
  Running setup.py clean for matplotlib
Failed to build matplotlib
Installing collected packages: matplotlib
  Running setup.py install for matplotlib ... error
  error: subprocess-exited-with-error

  × Running setup.py install for matplotlib did not run successfully.
  │ exit code: 1
  ╰─> [613 lines of output]

We are aware the the response to this kind of thing has been to make sure that pip, setuptools and wheel are fully updated and we have checked and they are.

Any help would be appreciated.

Your error comes from here:

ERROR: Failed building wheel for matplotlib

A wheel is an archived Python project consisting of one or more packages and their dependencies.

So, pip cannot proceed because it probably encountered some versioning conflicts.

( python3 -m pip list |less could help to find the bad guy)

From the FreeBSD-12.2-RELEASE ports collection, py-matplotlib BUILD depends on:

  • Python-3.7.9
    • matplotlib-3.3.1
    • numpy-1.16.6
    • pillow: >6.2
    • pyparsing >=0
    • certifi: >=0.10

Try install matplotlib through the port tree ( math/py-matplotlib ) instead, which guaranty compatibility if the dependencies have been installed through the port tree. If not, you could reinstall all dep. according to the matplotlib needs. The pip list above will show you what's going on.

You could either install it through pkg install , but it requires some precaution on a server: you have to check etc/pkg/pkg.conf (both system and local) and see if update is set to latest , quaterly of release ; in your case, release seems the right choice, according to how the system was previously configured.

For python packages that require compilation steps, like matplotlib , I used to install them through the ports collection (or the pkg repo), unless I really know them and know what they need. You will save your time.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM