2017-07-13 75 views
0

我不得不卸載Python 3.6.1並安裝3.5.0,因爲這是適用於TensorFlow的唯一版本。我正確地改變了我的路徑,並且在我成功安裝了第一個軟件包(numpy)後,出現了這個錯誤(前兩行)。我試圖這樣做,因爲它說和發生錯誤(如下圖),並試圖安裝熊貓和numpy的(abowe):Pip錯誤:應升級pip,pandas和matplotlib,但返回錯誤

C:\Users>pip3 install pandas matplotlib 
Collecting pandas 
    Using cached pandas-0.20.3.tar.gz 
Collecting matplotlib 
    Using cached matplotlib-2.0.2.tar.gz 
    Complete output from command python setup.py egg_info: 
============================================================================ 

Edit setup.cfg to change the build options 

BUILDING MATPLOTLIB 
      matplotlib: yes [2.0.2] 
       python: yes [3.5.0 (v3.5.0:374f501f4567, Sep 13 2015, 
         02:27:37) [MSC v.1900 64 bit (AMD64)]] 
       platform: yes [win32] 

REQUIRED DEPENDENCIES AND EXTENSIONS 
       numpy: yes [version 1.13.1] 
        six: yes [using six version 1.10.0] 
       dateutil: yes [using dateutil version 2.6.1] 
      functools32: yes [Not required] 
      subprocess32: yes [Not required] 
        pytz: yes [using pytz version 2017.2] 
       cycler: yes [cycler was not found. pip will attempt to 
         install it after matplotlib.] 
       tornado: yes [tornado was not found. It is required for the 
         WebAgg backend. pip/easy_install may attempt to 
         install it after matplotlib.] 
      pyparsing: yes [pyparsing was not found. It is required for 
         mathtext support. pip/easy_install may attempt to 
         install it after matplotlib.] 
       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: no [skipping due to configuration] 
     toolkits_tests: no [skipping due to configuration] 

OPTIONAL BACKEND EXTENSIONS 
       macosx: no [Mac OS-X only] 
       qt5agg: no [PyQt5 not found] 
       qt4agg: no [PySide not found; PyQt4 not found] 
       gtk3agg: no [Requires pygobject to be installed.] 
      gtk3cairo: no [Requires cairocffi or pycairo to be installed.] 

       gtkagg: no [Requires pygtk] 
       tkagg: yes [installing; run-time loading from Python Tcl/
         Tk] 
       wxagg: no [requires wxPython] 
        gtk: no [Requires pygtk] 
        agg: yes [installing] 
       cairo: no [cairocffi or pycairo not found] 
      windowing: yes [installing] 

OPTIONAL LATEX DEPENDENCIES 
       dvipng: no 
      ghostscript: no 
       latex: no 
       pdftops: no 

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

============================================================================ 

         * The following required packages can not be built: 
         * freetype, png 

---------------------------------------- 
Command "python setup.py egg_info" failed with error code 1 in 
C:\Users\Ap 
pData\Local\Temp\pip-build-qdqqojgq\matplotlib 

更新PIP:

C:\windows\system32>python -m pip install --upgrade pip 
Collecting pip 
Using cached pip-9.0.1-py2.py3-none-any.whl 
Installing collected packages: pip 
Found existing installation: pip 7.1.2 
Exception: 
Traceback (most recent call last): 
File "C:\Users\AppData\Local\Programs\Python\Python35\lib\site- 
packages\p 
ip\basecommand.py", line 211, in main 
status = self.run(options, args) 
File "C:\Users\AppData\Local\Programs\Python\Python35\lib\site- 
packages\p 
ip\commands\install.py", line 311, in run 
root=options.root_path, 
File "C:\Users\AppData\Local\Programs\Python\Python35\lib\site- 
packages\p 
ip\req\req_set.py", line 640, in install 
requirement.uninstall(auto_confirm=True) 
File "C:\Users\AppData\Local\Programs\Python\Python35\lib\site- 
packages\p 
ip\req\req_install.py", line 673, in uninstall 
for path in pip.wheel.uninstallation_paths(dist): 
File "C:\Users\AppData\Local\Programs\Python\Python35\lib\site- 
packages\p 
ip\wheel.py", line 512, in unique 
for item in fn(*args, **kw): 
File "C:\Users\AppData\Local\Programs\Python\Python35\lib\site- 
packages\p 
ip\wheel.py", line 531, in uninstallation_paths 
r = csv.reader(FakeFile(dist.get_metadata_lines('RECORD'))) 
File "C:\Users\Uroš\AppData\Local\Programs\Python\Python35\lib\site- 
packages\p 
ip\_vendor\pkg_resources\__init__.py", line 1619, in get_metadata_lines 
return yield_lines(self.get_metadata(name)) 
File "C:\Users\AppData\Local\Programs\Python\Python35\lib\site- 
packages\p 
ip\_vendor\pkg_resources\__init__.py", line 1616, in get_metadata 
return self._get(self._fn(self.egg_info, name)).decode("utf-8") 
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x9a in position 22368: 
inva 
lid start byte 
You are using pip version 7.1.2, however version 9.0.1 is available. 
You should consider upgrading via the 'python -m pip install --upgrade pip' 
comm 
and. 

我試圖下載輪,然後再安裝它:

C:\Users\Downloads>pip install matplotlib-2.0.2-cp36-cp36m-win32.whl 
matplotlib-2.0.2-cp36-cp36m-win32.whl is not a supported wheel on this 
platform. 

也試過與64 BT版本,同樣的故事。

任何想法該怎麼做,它甚至意味着什麼?

+1

包名之間的逗號造成所有錯誤。查看我的答案完整的步驟。一個過時的pip版本似乎並不是這裏的主要問題 – aim100k

回答

3

嘗試:pip3 install pandas matplotlib沒有逗號。我相信錯誤是如果你有空間以外的其他東西,pip正在尋找一個特定的版本。

看到:在鍵盤上 How to install multiple python packages at once using pip

+0

*以下必需的軟件包無法構建: * freetype,png ------------------ ---------------------- 命令「python setup.py egg_info」失敗,錯誤代碼爲1 C:\ Users \ URO〜1 \ Ap pData \ Local \ Temp \ pip-build-qdqqojgq \ matplotlib <<<<這就是發生了什麼 – econ

+0

我更新了我的原始帖子以獲得更好的清晰度。 – econ

+0

@econ這是修復舊錯誤後本質上的一個新錯誤。您的系統無法從源代碼構建freetype或png包。新的答案是必需的,我會發佈一個 –

1

按下windows鍵。 cmd 類型,然後按Ctrl + Shift + Enter啓動命令提示符管理

式中:

python -m pip install --upgrade pip 

然後安裝你想要什麼類型:

pip install pandas matplotlib 

注意包的名稱不以逗號分隔,而只是以空格分隔

+0

這不起作用,對不起。更新原始帖子。 – econ

1

此問題已經成爲一個新問題,因此需要一個新的答案。修復逗號問題後,系統開始對你大喊大叫,因爲matplotlib依賴於pip無法安裝的軟件包,無需將源代碼編譯爲二進制文件,即freetype和png。從理論上講,你可以設置一個編譯器並且全部工作,但這對我們大多數人來說是一個真正的痛苦。

你問題的答案是徹底清除你的python安裝並重新開始。這一次,安裝Anaconda python distribution,而不是pip安裝matplotlib,請使用conda安裝matplotlib。實際上,如果你安裝完整的Anaconda發行版,matplotlib將已經在那裏。

Anaconda的美妙之處在於它們跟蹤大量預編譯包的集合,因此您不必擔心以pip方式構建所有這些東西。

如果你不想這樣做,並希望保持當前的python設置,你可以從Christopher Gholke website下載所有的輪子,並使用pip來安裝輪子。這些包包含您所需要的編譯的二進制文件是不能直接從您從該網站需要http://www.lfd.uci.edu/~gohlke/pythonlibs/ 只需下載WHL文件,但畫中畫文件夾中安裝filename.whl該文件是PyPI將

1

下載所有的模塊。希望這對你有所幫助。