簡體   English   中英

ubuntu 14.04,pip無法升級matplotllib

[英]ubuntu 14.04, pip cannot upgrade matplotllib

當我嘗試使用pip升級matplotlib時,輸出:

Downloading/unpacking matplotlib from https://pypi.python.org/packages/source/m/matplotlib/matplotlib-1.4.0.tar.gz#md5=1daf7f2123d94745feac1a30b210940c
  Downloading matplotlib-1.4.0.tar.gz (51.2MB): 51.2MB downloaded
  Running setup.py (path:/tmp/pip_build_root/matplotlib/setup.py) egg_info for package matplotlib
    ============================================================================
    Edit setup.cfg to change the build options

    BUILDING MATPLOTLIB
                matplotlib: yes [1.4.0]
                    python: yes [2.7.6 (default, Mar 22 2014, 22:59:38)  [GCC
                            4.8.2]]
                  platform: yes [linux2]

    REQUIRED DEPENDENCIES AND EXTENSIONS
                     numpy: yes [version 1.8.2]
                       six: yes [using six version 1.7.3]
                  dateutil: yes [using dateutil version 2.2]
                   tornado: yes [using tornado version 4.0.1]
                 pyparsing: yes [using pyparsing version 2.0.2]
                     pycxx: yes [Couldn't import.  Using local copy.]
                    libagg: yes [pkg-config information for 'libagg' could not
                            be found. Using local copy.]
    Traceback (most recent call last):
      File "<string>", line 17, in <module>
      File "/tmp/pip_build_root/matplotlib/setup.py", line 154, in <module>
        result = package.check()
      File "setupext.py", line 940, in check
        if 'No such file or directory\ngrep:' in version:
    TypeError: argument of type 'NoneType' is not iterable
    Complete output from command python setup.py egg_info:
    ============================================================================

Edit setup.cfg to change the build options



BUILDING MATPLOTLIB

            matplotlib: yes [1.4.0]

                python: yes [2.7.6 (default, Mar 22 2014, 22:59:38)  [GCC

                        4.8.2]]

              platform: yes [linux2]



REQUIRED DEPENDENCIES AND EXTENSIONS

                 numpy: yes [version 1.8.2]

                   six: yes [using six version 1.7.3]

              dateutil: yes [using dateutil version 2.2]

               tornado: yes [using tornado version 4.0.1]

             pyparsing: yes [using pyparsing version 2.0.2]

                 pycxx: yes [Couldn't import.  Using local copy.]

                libagg: yes [pkg-config information for 'libagg' could not

                        be found. Using local copy.]

Traceback (most recent call last):

  File "<string>", line 17, in <module>

  File "/tmp/pip_build_root/matplotlib/setup.py", line 154, in <module>

    result = package.check()

  File "setupext.py", line 940, in check

    if 'No such file or directory\ngrep:' in version:

TypeError: argument of type 'NoneType' is not iterable

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/matplotlib
Storing debug log for failure in /home/username/.pip/pip.log

在日志的末尾說:

Exception information:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/pip-1.5.6-py2.7.egg/pip/basecommand.py", line 122, in main
    status = self.run(options, args)
  File "/usr/local/lib/python2.7/dist-packages/pip-1.5.6-py2.7.egg/pip/commands/install.py", line 278, in run
    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
  File "/usr/local/lib/python2.7/dist-packages/pip-1.5.6-py2.7.egg/pip/req.py", line 1229, in prepare_files
    req_to_install.run_egg_info()
  File "/usr/local/lib/python2.7/dist-packages/pip-1.5.6-py2.7.egg/pip/req.py", line 325, in run_egg_info
    command_desc='python setup.py egg_info')
  File "/usr/local/lib/python2.7/dist-packages/pip-1.5.6-py2.7.egg/pip/util.py", line 697, in call_subprocess
    % (command_desc, proc.returncode, cwd))
InstallationError: Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/matplotlib

為什么失敗了? 非常感謝!

這是一個已知的錯誤,已在master上修復( https://github.com/matplotlib/matplotlib/pull/3414 )。

該錯誤在於搜索自由類型安裝的處理。 如果安裝Linux軟件包freetype-dev,則可以避免該錯誤並能夠編譯matplotlib

sudo apt-get install libfreetype6-dev

在Ubuntu 14服務器上,您還需要安裝libxft-dev

sudo apt-get install libfreetype6-dev libxft-dev

嘗試使用pip3在Python 3上安裝matplotlib ,我遇到了同樣的問題,看來這個問題與Python 3的准系統安裝有關,並且執行以下操作:

sudo apt-get build-dep matplotlib

其次是

sudo pip3 install matplotlib 

與僅選擇性地安裝與matplotlib相關的庫相比,它是一個更好的解決方案。

由於mac沒有apt-get,因此在OSX上,您可能需要執行以下操作:

brew install freetype

然后您可以運行:

pip install matplotlib

在尋找fedora 24的答案時找到了此頁面。

RPM解決方案是:

dnf install freetype-devel

如果您正在運行Ubuntu服務器14.04,則應添加此字體依賴項

sudo apt-get install libxft-dev

資源

我也嘗試直接使用sudo pip更新,但更改未保存在最后。 所以我首先在終端中使用update cmd:

sudo apt-get update

然后我用sudo install:

sudo apt-get install libffi-dev

最后通過執行此方法安裝它。

對於使用Fedora 25的用戶,我需要以下兩個軟件包才能使其正常工作:

sudo dnf install freetype-devel gcc-c++

這為我工作:

python -m pip install -U pip setuptools
python -m pip install matplotlib

有關更多詳細信息,請訪問: https : //matplotlib.org/2.0.0/users/installing.html

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM