python安裝pillow時出錯(ubuntu)

來源:互聯網
上載者:User

標籤:python錯誤

在進行影像處理時可能會用到的包: pillow
在安裝時可能會遇到的錯誤資訊中包含 setuptools等關鍵字,此時需要執行一下命令來安裝基本環境:

apt-get install libjpeg8 libjpeg62-dev libfreetype6 libfreetype6-dev python-dev

在執行此命令時可能會遇到找不到包的問題,是因為更換源的原因,我是將源更換為了阿里的鏡像,雖然速度變快了,但是會遇到找不到安裝包的錯誤,此時的處理方法是將鏡像源換回原來的,執行以下命令:

mv /etc/apt/sources.list{,.bak}vim /etc/apt/sources.list

在開啟的編輯器中輸入以下網址:

deb http://us.archive.ubuntu.com/ubuntu/ trusty main restricteddeb-src http://us.archive.ubuntu.com/ubuntu/ trusty main restricteddeb http://us.archive.ubuntu.com/ubuntu/ trusty-updates main restricteddeb-src http://us.archive.ubuntu.com/ubuntu/ trusty-updates main restricteddeb http://us.archive.ubuntu.com/ubuntu/ trusty universedeb-src http://us.archive.ubuntu.com/ubuntu/ trusty universedeb http://us.archive.ubuntu.com/ubuntu/ trusty-updates universedeb-src http://us.archive.ubuntu.com/ubuntu/ trusty-updates universedeb http://us.archive.ubuntu.com/ubuntu/ trusty multiversedeb-src http://us.archive.ubuntu.com/ubuntu/ trusty multiversedeb http://us.archive.ubuntu.com/ubuntu/ trusty-updates multiversedeb-src http://us.archive.ubuntu.com/ubuntu/ trusty-updates multiversedeb http://us.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiversedeb-src http://us.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiversedeb http://security.ubuntu.com/ubuntu trusty-security main restricteddeb-src http://security.ubuntu.com/ubuntu trusty-security main restricteddeb http://security.ubuntu.com/ubuntu trusty-security universedeb-src http://security.ubuntu.com/ubuntu trusty-security universedeb http://security.ubuntu.com/ubuntu trusty-security multiversedeb-src http://security.ubuntu.com/ubuntu trusty-security multiverse

然後儲存退出並執行以下命令更新:

apt-get update

更新完成之後,再次執行命令:

apt-get install libjpeg8 libjpeg62-dev libfreetype6 libfreetype6-dev python-dev

最後執行命令安裝pillow即可:

pip install pillow

python安裝pillow時出錯(ubuntu)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.