使用setup.py安装后再安装matplotlib

时间:2019-02-11 17:29:03

标签: python python-3.x matplotlib

我从源代码安装了matplotlib,并从这里https://github.com/matplotlib/matplotlib

运行了python3 setup.py install

如何卸载此程序? (我忘了在容器中做

这个答案How do I remove packages installed with Python's easy_install?显示了如何使用pip进行操作,但是我没有使用pip进行安装,而且我不确定该软件包的名称。

matplotlib未能成功安装,但它将许多文件复制到了build文件夹并认为已运行build。

这是安装时所打印内容的一部分:

python3 setup.py install
IMPORTANT WARNING:
    pkg-config is not installed.
    matplotlib may not be able to find some of its dependencies
================================================================================
Edit setup.cfg to change the build options

BUILDING MATPLOTLIB
  matplotlib: yes [0+untagged.1.g692ab97]
      python: yes [3.7.2 (default, Jan 13 2019, 12:50:15)  [Clang 10.0.0
                  (clang-1000.11.45.5)]]
    platform: yes [darwin]

OPTIONAL SUBPACKAGES
 sample_data: yes [installing]
       tests: yes [installing]

OPTIONAL BACKEND EXTENSIONS
         agg: yes [installing]
       tkagg: yes [installing; run-time loading from Python Tcl/Tk]
      macosx: yes [installing, darwin]

OPTIONAL PACKAGE DATA
        dlls: no  [skipping due to configuration]

running install
running bdist_egg
running egg_info
creating lib/matplotlib.egg-info
writing lib/matplotlib.egg-info/PKG-INFO
writing dependency_links to lib/matplotlib.egg-info/dependency_links.txt
writing namespace_packages to lib/matplotlib.egg-info/namespace_packages.txt
writing requirements to lib/matplotlib.egg-info/requires.txt
writing top-level names to lib/matplotlib.egg-info/top_level.txt
writing manifest file 'lib/matplotlib.egg-info/SOURCES.txt'
reading manifest file 'lib/matplotlib.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'lib/matplotlib.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.13-x86_64/egg
running install_lib
running build_py
creating build
creating build/lib.macosx-10.13-x86_64-3.7
copying lib/pylab.py -> build/lib.macosx-10.13-x86_64-3.7
creating build/lib.macosx-10.13-x86_64-3.7/mpl_toolkits
copying lib/mpl_toolkits/__init__.py -> build/lib.macosx-10.13-x86_64-3.7/mpl_toolkits
creating build/lib.macosx-10.13-x86_64-3.7/matplotlib
copying lib/matplotlib/hatch.py -> build/lib.macosx-10.13-x86_64-3.7/matplotlib
copying lib/matplotlib/transforms.py -> build/lib.macosx-10.13-x86_64-3.7/matplotlib
copying lib/matplotlib/legend_handler.py -> build/lib.macosx-10.13-x86_64-3.7/matplotlib
copying lib/matplotlib/axis.py -> build/lib.macosx-10.13-x86_64-3.7/matplotlib
copying lib/matplotlib/textpath.py -> build/lib.macosx-10.13-x86_64-3.7/matplotlib
copying lib/matplotlib/quiver.py -> build/lib.macosx-10.13-x86_64-3.7/matplotlib
copying lib/matplotlib/backend_bases.py -> build/lib.macosx-10.13-x86_64-3.7/matplotlib
copying lib/matplotlib/units.py -> build/lib.macosx-10.13-x86_64-3.7/matplotlib
copying lib/matplotlib/pylab.py -> build/lib.macosx-10.13-x86_64-3.7/matplotlib
copying lib/matplotlib/colorbar.py -> build/lib.macosx-10.13-x86_64-3.7/matplotlib
copying lib/matplotlib/_version.py -> build/lib.macosx-10.13-x86_64-3.7/matplotlib
copying lib/matplotlib/_cm.py -> build/lib.macosx-10.13-x86_64-3.7/matplotlib
copying lib/matplotlib/backend_managers.py -> build/lib.macosx-10.13-x86_64-3.7/matplotlib
copying lib/matplotlib/mathtext.py -> build/lib.macosx-10.13-x86_64-3.7/matplotlib
copying lib/matplotlib/font_manager.py -> build/lib.macosx-10.13-x86_64-3.7/matplotlib
copying lib/matplotlib/bezier.py -> build/lib.macosx-10.13-x86_64-3.7/matplotlib/tests/baseline_images/test_mathtext
copying lib/matplotlib/mpl-data/fonts/afm/pcrbo8a.afm -> build/lib.macosx-10.13-x86_64-3.7/matplotlib/mpl-data/fonts/afm
copying lib/matplotlib/tests/baseline_images/test_mathtext/mathtext_dejavuserif_82.png -> build/lib.macosx-10.13-x86_64-3.7/matplotlib/tests/baseline_images/test_mathtext
copying lib/matplotlib/tests/baseline_images/test_text/multiline2.pdf -> build/lib.macosx-10.13-x86_64-3.7/matplotlib/tests/baseline_images/test_text
copying lib/matplotlib/tests/baseline_images/test_mathtext/mathtext_stix_79.pdf -> build/lib.macosx-10.13-x86_64-3.7/matplotlib/tests/baseline_images/test_mathtext
copying lib/matplotlib/tests/baseline_images/test_mathtext/mathtext_cm_66.svg -> build/lib.macosx-10.13-x86_64-3.7/matplotlib/tests/baseline_images/test_mathtext
copying lib/matplotlib/tests/baseline_images/test_mathtext/mathtext_stix_81.svg -> build/lib.macosx-10.13-x86_64-3.7/matplotlib/tests/baseline_images/test_mathtext
copying lib/matplotlib/tests/baseline_images/test_mathtext/mathtext_dejavuserif_57.svg -> build/lib.macosx-10.13-x86_64-3.7/matplotlib/tests/baseline_images/test_mathtext
copying lib/matplotlib/tests/baseline_images/test_patches/multi_color_hatch.svg -> build/lib.macosx-10.13-x86_64-3.7/matplotlib/tests/baseline_images/test_patches
copying lib/matplotlib/tests/baseline_images/test_text/text_alignment.svg -> build/lib.macosx-10.13-x86_64-3.7/matplotlib/tests/baseline_images/test_text
copying lib/matplotlib/tests/baseline_images/test_mathtext/mathtext_stix_51.svg -> build/lib.macosx-10.13-x86_64-3.7/matplotlib/tests/baseline_images/test_mathtext
copying lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_cm_13.png -> build/lib.macosx-10.13-x86_64-3.7/matplotlib/tests/baseline_images/test_mathtext
copying lib/matplotlib/backends/web_backend/jquery/css/themes/base/images/ui-icons_ef8c08_256x240.png -> build/lib.macosx-10.13-x86_64-3.7/matplotlib/backends/web_backend/jquery/css/themes/base/images
copying lib/matplotlib/tests/baseline_images/test_axes/axvspan_epoch.png -> build/lib.macosx-10.13-x86_64-3.7/matplotlib/tests/baseline_images/test_axes
copying lib/matplotlib/tests/baseline_images/test_axes/polar_wrap_180.svg -> build/lib.macosx-10.13-x86_64-3.7/matplotlib/tests/baseline_images/test_axes
copying lib/matplotlib/tests/baseline_images/test_tightlayout/tight_layout1.svg -> build/lib.macosx-10.13-x86_64-3.7/matplotlib/tests/baseline_images/test_tightlayout
copying lib/matplotlib/tests/baseline_images/test_quiver/quiver_with_key_test_image.png -> build/lib.macosx-10.13-x86_64-3.7/matplotlib/tests/baseline_images/test_quiver
copying lib/matplotlib/tests/baseline_images/test_scale/logscale_nonpos_values.png -> build/lib.macosx-10.13-x86_64-3.7/matplotlib/tests/baseline_images/test_scale
copying lib/matplotlib/tests/baseline_images/test_mathtext/mathtext_dejavusans_47.pdf -> build/lib.macosx-10.13-x86_64-3.7/matplotlib/tests/baseline_images/test_mathtext
copying lib/matplotlib/tests/baseline_images/test_axes/hist_step_bottom.png -> build/lib.macosx-10.13-x86_64-3.7/matplotlib/tests/baseline_images/test_axes
copying lib/matplotlib/tests/baseline_images/test_mathtext/mathtext_stixsans_01.pdf -> build/lib.macosx-10.13-x86_64-3.7/matplotlib/tests/baseline_images/test_mathtext
copying lib/matplotlib/tests/baseline_images/test_simplification/fft_peaks.pdf -> build/lib.macosx-10.13-x86_64-3.7/matplotlib/tests/baseline_images/test_simplification
copying lib/matplotlib/tests/baseline_images/test_legend/framealpha.svg -> build/lib.macosx-10.13-x86_64-3.7/matplotlib/tests/baseline_images/test_legend
copying lib/matplotlib/tests/baseline_images/test_mathtext/mathtext_dejavuserif_37.svg -> build/lib.macosx-10.13-x86_64-3.7/matplotlib/tests/baseline_images/test_mathtext
copying lib/matplotlib/mpl-data/images/subplots_large.gif -> build/lib.macosx-10.13-x86_64-3.7/matplotlib/mpl-data/images
copying lib/matplotlib/tests/baseline_images/test_mathtext/mathtext_dejavusans_80.svg -> build/lib.macosx-10.13-x86_64-3.7/matplotlib/tests/baseline_images/test_mathtext
copying lib/matplotlib/tests/baseline_images/test_mathtext/mathtext_stix_28.png -> build/lib.macosx-10.13-x86_64-3.7/matplotlib/tests/baseline_images/test_mathtext
copying lib/matplotlib/tests/baseline_images/test_mathtext/mathtext_dejavuserif_48.pdf -> build/lib.macosx-10.13-x86_64-3.7/matplotlib/tests/baseline_images/test_mathtext
copying lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_stixsans_02.png -> build/lib.macosx-10.13-x86_64-3.7/matplotlib/tests/baseline_images/test_mathtext
copying lib/matplotlib/mpl-data/images/hand.pdf -> build/lib.macosx-10.13-x86_64-3.7/matplotlib/mpl-data/images
copying lib/matplotlib/tests/baseline_images/test_mathtext/mathtext_cm_70.pdf -> build/lib.macosx-10.13-x86_64-3.7/matplotlib/tests/baseline_images/test_mathtext
copying lib/matplotlib/tests/baseline_images/test_axes/bxp_baseline.png -> build/lib.macosx-10.13-x86_64-3.7/matplotlib/tests/baseline_images/test_axes
copying lib/matplotlib/tests/baseline_images/test_mathtext/mathtext_stixsans_53.png -> build/lib.macosx-10.13-x86_64-3.7/matplotlib/tests/baseline_images/test_mathtext
copying lib/matplotlib/tests/baseline_images/test_legend/scatter_rc1.pdf -> build/lib.macosx-10.13-x86_64-3.7/matplotlib/tests/baseline_images/test_legend
copying lib/matplotlib/tests/baseline_images/test_axes/axhspan_epoch.svg -> build/lib.macosx-10.13-x86_64-3.7/matplotlib/tests/baseline_images/test_axes
copying lib/matplotlib/tests/baseline_images/test_mathtext/mathtext_cm_01.png -> build/lib.macosx-10.13-x86_64-3.7/matplotlib/tests/baseline_images/test_mathtext
UPDATING build/lib.macosx-10.13-x86_64-3.7/matplotlib/_version.py
set build/lib.macosx-10.13-x86_64-3.7/matplotlib/_version.py to '0+untagged.1.g692ab97'
running build_ext
building 'matplotlib.ft2font' extension
creating build/temp.macosx-10.13-x86_64-3.7
creating build/temp.macosx-10.13-x86_64-3.7/src
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DFREETYPE_BUILD_TYPE=system -DPY_ARRAY_UNIQUE_SYMBOL=MPL_matplotlib_ft2font_ARRAY_API -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -D__STDC_FORMAT_MACROS=1 -I/Users/ahmedayman/Documents/CSCD01/matplotlib/.eggs/numpy-1.16.1-py3.7-macosx-10.13-x86_64.egg/numpy/core/include -Iextern/agg24-svn/include -I/usr/local/include -I/usr/include -I. -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c src/checkdep_freetype2.c -o build/temp.macosx-10.13-x86_64-3.7/src/checkdep_freetype2.o
src/checkdep_freetype2.c:1:10: fatal error: 'ft2build.h' file not found
#include <ft2build.h>
         ^~~~~~~~~~~~
1 error generated.
error: command 'clang' failed with exit status 1
Ahmeds-MacBook-Air:matplotlib ahmedayman$ ls
INSTALL.rst     doc         setupext.py
LICENSE         examples        src
MANIFEST.in     extern          tests.py
README.rst      lib         tools
__pycache__     matplotlibrc.template   tox.ini
azure-pipelines.yml pytest.ini      tutorials
build           requirements        versioneer.py
build_alllocal.cmd  setup.cfg.template
ci          setup.py
Ahmeds-MacBook-Air:matplotlib ahmedayman$ python setup.py install --record files.txt

Beginning with Matplotlib 3.1, Python 3.6 or above is required.

This may be due to an out of date pip.

Make sure you have pip >= 9.0.1.

Ahmeds-MacBook-Air:matplotlib ahmedayman$ python3 setup.py install --record files.txt
IMPORTANT WARNING:
    pkg-config is not installed.
    matplotlib may not be able to find some of its dependencies
================================================================================
Edit setup.cfg to change the build options

BUILDING MATPLOTLIB
  matplotlib: yes [0+untagged.1.g692ab97]
      python: yes [3.7.2 (default, Jan 13 2019, 12:50:15)  [Clang 10.0.0
                  (clang-1000.11.45.5)]]
    platform: yes [darwin]

OPTIONAL SUBPACKAGES
 sample_data: yes [installing]
       tests: yes [installing]

OPTIONAL BACKEND EXTENSIONS
         agg: yes [installing]
       tkagg: yes [installing; run-time loading from Python Tcl/Tk]
      macosx: yes [installing, darwin]

OPTIONAL PACKAGE DATA
        dlls: no  [skipping due to configuration]

running install
running bdist_egg
running egg_info
writing lib/matplotlib.egg-info/PKG-INFO
writing dependency_links to lib/matplotlib.egg-info/dependency_links.txt
writing namespace_packages to lib/matplotlib.egg-info/namespace_packages.txt
writing requirements to lib/matplotlib.egg-info/requires.txt
writing top-level names to lib/matplotlib.egg-info/top_level.txt
reading manifest file 'lib/matplotlib.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'lib/matplotlib.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.13-x86_64/egg
running install_lib
running build_py
copying lib/matplotlib/mpl-data/matplotlibrc -> build/lib.macosx-10.13-x86_64-3.7/matplotlib/mpl-data
UPDATING build/lib.macosx-10.13-x86_64-3.7/matplotlib/_version.py
set build/lib.macosx-10.13-x86_64-3.7/matplotlib/_version.py to '0+untagged.1.g692ab97'
running build_ext
building 'matplotlib.ft2font' extension
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DFREETYPE_BUILD_TYPE=system -DPY_ARRAY_UNIQUE_SYMBOL=MPL_matplotlib_ft2font_ARRAY_API -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -D__STDC_FORMAT_MACROS=1 -I/Users/ahmedayman/Documents/CSCD01/matplotlib/.eggs/numpy-1.16.1-py3.7-macosx-10.13-x86_64.egg/numpy/core/include -Iextern/agg24-svn/include -I/usr/local/include -I/usr/include -I. -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c src/checkdep_freetype2.c -o build/temp.macosx-10.13-x86_64-3.7/src/checkdep_freetype2.o
src/checkdep_freetype2.c:1:10: fatal error: 'ft2build.h' file not found
#include <ft2build.h>
         ^~~~~~~~~~~~
1 error generated.
error: command 'clang' failed with exit status 1

1 个答案:

答案 0 :(得分:0)

尝试通俗易懂的matplotlib,并确保您具有最新版本的pip。我曾经遇到过这个问题,并且已经解决了。 尝试python -m pip uninstall -U matplotlib,然后重新安装。