python中安裝第三方模組

來源:互聯網
上載者:User

標籤:

Python有兩個封裝了setuptools的包管理工具:easy_installpip。目前官方推薦使用pip

現在,讓我們來安裝一個第三方庫——Python Imaging Library,這是Python下非常強大的處理映像的工具庫。一般來說,第三方庫都會在Python官方的pypi.python.org網站註冊,要安裝一個第三方庫,必須Crowdsourced Security Testing道該庫的名稱,可以在官網或者pypi上搜尋,比如Python Imaging Library的名稱叫PIL,因此,安裝Python Imaging Library的命令就是:

pip install PIL

出現如下問題:

Traceback (most recent call last): File “/usr/bin/pip-python”, line 5, in <module> from pkg_resources import load_entry_point File “build/bdist.linux-x86_64/egg/pkg_resources.py”, line 2749, in <module> File “build/bdist.linux-x86_64/egg/pkg_resources.py”, line 444, in _build_master File “build/bdist.linux-x86_64/egg/pkg_resources.py”, line 725, in require File “build/bdist.linux-x86_64/egg/pkg_resources.py”, line 628, in resolve pkg_resources.DistributionNotFound: pip==0.8

出現上述錯誤主要是由於python的版本太過老了,需要下載最新版本的setuptools

 無奈之下,只好去安裝easy_install並安裝。

easy_install PIL
--------------------------------------------------------------------PIL 1.1.7 SETUP SUMMARY--------------------------------------------------------------------version       1.1.7platform      linux2 2.7.3 (default, Jul  2 2014, 09:15:41)              [GCC 4.8.1]--------------------------------------------------------------------*** TKINTER support not available--- JPEG support available--- ZLIB (PNG/ZIP) support available--- FREETYPE2 support available*** LITTLECMS support not available--------------------------------------------------------------------To add a missing option, make sure you have the requiredlibrary, and set the corresponding ROOT variable in thesetup.py script.To check the build, run the selftest.py script.zip_safe flag not set; analyzing archive contents...Image: module references __file__Adding PIL 1.1.7 to easy-install.pth fileInstalling pilprint.py script to /usr/local/binInstalling pilfile.py script to /usr/local/binInstalling pilconvert.py script to /usr/local/binInstalling pildriver.py script to /usr/local/binInstalling pilfont.py script to /usr/local/binInstalled /usr/local/lib/python2.7/site-packages/PIL-1.1.7-py2.7-linux-i686.eggProcessing dependencies for PILFinished processing dependencies for PIL

 

python中安裝第三方模組

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.