2016-04-28 5 views

答えて

1

matplotlibをインストールするときに表示されるオプションの依存出力は、setupext.pyで定義された一連の環境テスターに​​よって生成されます。これらのリストがあり、順番に彼らはsetup.pyで、表示されますので、どのようにPythonのインストール作品の、

for package in mpl_packages: 
    if isinstance(package, str): 
     print_raw('') 
     print_raw(package.upper()) 
    else: 
     try: 
      result = package.check() 
      if result is not None: 
       message = 'yes [%s]' % result 
       print_status(package.name, message) 
     except setupext.CheckFailed as e: 
      msg = str(e).strip() 
      if len(msg): 
       print_status(package.name, 'no [%s]' % msg) 
      else: 
       print_status(package.name, 'no') 
      if not package.optional: 
       required_failed.append(package) 
     else: 
      good_packages.append(package) 
      if isinstance(package, setupext.OptionalBackendPackage): 
       if default_backend is None: 
        default_backend = package.name 

残念ながら:

は、実際のチェックがさらに下、同じファイルである
mpl_packages = [ 
    'Building Matplotlib', 
    setupext.Matplotlib(), 
    setupext.Python(), 
    setupext.Platform(), 
    'Required dependencies and extensions', 
    setupext.Numpy(), 
    setupext.Dateutil(), 
    setupext.FuncTools32(), 
    setupext.Pytz(), 
    setupext.Cycler(), 
    setupext.Tornado(), 
    setupext.Pyparsing(), 
    setupext.LibAgg(), 
    setupext.FreeType(), 
    setupext.FT2Font(), 
    setupext.Png(), 
    setupext.Qhull(), 
    setupext.Image(), 
    setupext.TTConv(), 
    setupext.Path(), 
    setupext.ContourLegacy(), 
    setupext.Contour(), 
    setupext.Delaunay(), 
    setupext.QhullWrap(), 
    setupext.Tri(), 
    setupext.Externals(), 
    'Optional subpackages', 
    setupext.SampleData(), 
    setupext.Toolkits(), 
    setupext.Tests(), 
    setupext.Toolkits_Tests(), 
    'Optional backend extensions', 
    # These backends are listed in order of preference, the first 
    # being the most preferred. The first one that looks like it will 
    # work will be selected as the default backend. 
    setupext.BackendMacOSX(), 
    setupext.BackendQt5(), 
    setupext.BackendQt4(), 
    setupext.BackendGtk3Agg(), 
    setupext.BackendGtk3Cairo(), 
    setupext.BackendGtkAgg(), 
    setupext.BackendTkAgg(), 
    setupext.BackendWxAgg(), 
    setupext.BackendGtk(), 
    setupext.BackendAgg(), 
    setupext.BackendCairo(), 
    setupext.Windowing(), 
    'Optional LaTeX dependencies', 
    setupext.DviPng(), 
    setupext.Ghostscript(), 
    setupext.LaTeX(), 
    setupext.PdfToPs(), 
    'Optional package data', 
    setupext.Dlls(), 
    ] 

matplotlibをインストールしてもこれらのファイルは利用できません。ただし、matplotlibソース(またはrepo)のコピーを持っている場合は、は、以下のようにmatplotlibの完全な再インストールを行わずにチェックを実行できます。

まず、matplotlibのソースフォルダをsys.pathに追加し、ディレクトリをフォルダに変更します(この2番目の手順はversioneer.pyが機能するために必要です)。

import os, sys 
PATH = r'\your\path\to\matplotlib' 
sys.path.append(PATH) 
import setupext # setupext.py contains the dependency definitions 

os.chdir(PATH) 

次に、テストするパッケージ/依存関係のリストを定義します。

mpl_packages = [ 
    'Building Matplotlib', 
    setupext.Matplotlib(), 
    setupext.Python(), 
    setupext.Platform(), 
    'Required dependencies and extensions', 
    setupext.Numpy(), 
    setupext.Dateutil(), 
    setupext.FuncTools32(), 
    setupext.Pytz(), 
    setupext.Cycler(), 
    setupext.Tornado(), 
    setupext.Pyparsing(), 
    setupext.LibAgg(), 
    setupext.FreeType(), 
    setupext.FT2Font(), 
    setupext.Png(), 
    setupext.Qhull(), 
    setupext.Image(), 
    setupext.TTConv(), 
    setupext.Path(), 
    setupext.ContourLegacy(), 
    setupext.Contour(), 
    setupext.Delaunay(), 
    setupext.QhullWrap(), 
    setupext.Tri(), 
    setupext.Externals(), 
    'Optional subpackages', 
    setupext.SampleData(), 
    setupext.Toolkits(), 
    setupext.Tests(), 
    setupext.Toolkits_Tests(), 
    'Optional backend extensions', 
    # These backends are listed in order of preference, the first 
    # being the most preferred. The first one that looks like it will 
    # work will be selected as the default backend. 
    setupext.BackendMacOSX(), 
    setupext.BackendQt5(), 
    setupext.BackendQt4(), 
    setupext.BackendGtk3Agg(), 
    setupext.BackendGtk3Cairo(), 
    setupext.BackendGtkAgg(), 
    setupext.BackendTkAgg(), 
    setupext.BackendWxAgg(), 
    setupext.BackendGtk(), 
    setupext.BackendAgg(), 
    setupext.BackendCairo(), 
    setupext.Windowing(), 
    'Optional LaTeX dependencies', 
    setupext.DviPng(), 
    setupext.Ghostscript(), 
    setupext.LaTeX(), 
    setupext.PdfToPs(), 
    'Optional package data', 
    setupext.Dlls(), 
    ] 

最後に、オプションのパッケージを繰り返してテストします。このカット・ダウン・テスト・ループは、/ etcの格納を心配せずに各依存性検査の結果を出力します。

BUILDING MATPLOTLIB 
matplotlib yes [1.5.0+319.g781605a] 
python yes [3.5.1 |Anaconda 4.0.0 (64-bit)| (default, Feb 16 2016, 09:49:46) [MSC v.1900 64 bit (AMD64)]] 
platform yes [win32] 

REQUIRED DEPENDENCIES AND EXTENSIONS 
numpy yes [version 1.10.4] 
dateutil yes [using dateutil version 2.5.2] 
functools32 yes [Not required] 
pytz yes [using pytz version 2016.3] 
cycler yes [using cycler version 0.10.0] 
tornado yes [using tornado version 4.3] 
pyparsing yes [using pyparsing version 2.0.3] 
libagg yes [pkg-config information for 'libagg' could not be found. Using local copy.] 
freetype no [The C/C++ header for freetype (ft2build.h) could not be found. You may need to install the development package.] 
png no [The C/C++ header for png (png.h) could not be found. You may need to install the development package.] 
qhull yes [pkg-config information for 'qhull' could not be found. Using local copy.] 

OPTIONAL SUBPACKAGES 
sample_data yes [installing] 
toolkits yes [installing] 
tests yes [using nose version 1.3.7/using unittest.mock] 
toolkits_tests yes [using nose version 1.3.7/using unittest.mock] 

OPTIONAL BACKEND EXTENSIONS 
macosx no [Mac OS-X only] 
qt5agg no [PyQt5 not found] 
qt4agg yes [installing, Qt: 4.8.7, PyQt: 4.8.7; PySide not found] 
gtk3agg no [Requires pygobject to be installed.] 
gtk3cairo no [Requires cairocffi or pycairo to be installed.] 
gtkagg no [Requires pygtk] 
tkagg no [The C/C++ header for Tk (tk.h) could not be found. You may need to install the development package.] 
wxagg no [requires wxPython] 
gtk no [Requires pygtk] 
agg yes [installing] 
cairo no [cairocffi or pycairo not found] 
windowing yes [installing, installing] 

OPTIONAL LATEX DEPENDENCIES 
dvipng yes [version 1.12] 
ghostscript no 
latex yes [version MiKTeX 2.9] 
pdftops no 

OPTIONAL PACKAGE DATA 
dlls no [skipping due to configuration] 
:私の現在のシステムで

for package in mpl_packages: 
    if isinstance(package, str): 
     print('') 
     print(package.upper()) 
    else: 
     try: 
      result = package.check() 
      if result is not None: 
       message = 'yes [%s]' % result 
       print(package.name, message) 
     except setupext.CheckFailed as e: 
      msg = str(e).strip() 
      if len(msg): 
       print(package.name, 'no [%s]' % msg) 
      else: 
       print(package.name, 'no') 

は、これは私に次のような出力を提供します

関連する問題