python安装media库过程以及遇到
安装环境:ubuntu 13.10 32位操作系统
之前安装总是报错:IOError: decoder zip not available
还有个报无法找到 imag.py啥的。
后来问题解决,记录下来。
首先,下载media库源文件:
网址:http://www.pragprog.com/titles/gwpy/source_code
下载完成之后,解压缩,得到一个code文件夹。
cd code/install/cpython/
进入目录之后,输入命令:
sudo apt-get install python-imaging python-imaging-tk python-pygame python-numpy python-setuptools
sudo python setup.py install
安装完成之后。
安装pip:sudo apt-get install python-pip
再安装:sudo apt-get install libjpeg8 libjpeg62-dev libfreetype6 libfreetype6-dev
最后执行:sudo pip install -U PIL
出现如下画面,安装结束。
--------------------------------------------------------------------
PIL 1.1.7 SETUP SUMMARY
--------------------------------------------------------------------
version 1.1.7
platform linux2 2.7.5+ (default, Sep 19 2013, 13:49:51)
[GCC 4.8.1]
--------------------------------------------------------------------
*** TKINTER support not available (Tcl/Tk 8.5 libraries needed)
*** JPEG support not available
--- ZLIB (PNG/ZIP) support available
*** FREETYPE2 support not available
*** LITTLECMS support not available
--------------------------------------------------------------------
To add a missing option, make sure you have the required
library, and set the corresponding ROOT variable in the
setup.py script.
To check the build, run the selftest.py script.
changing mode of build/scripts-2.7/pildriver.py from 644 to 755
changing mode of build/scripts-2.7/pilconvert.py from 644 to 755
changing mode of build/scripts-2.7/pilfile.py from 644 to 755
changing mode of build/scripts-2.7/pilprint.py from 644 to 755
changing mode of build/scripts-2.7/pilfont.py from 644 to 755
changing mode of /usr/local/bin/pildriver.py to 755
changing mode of /usr/local/bin/pilconvert.py to 755
changing mode of /usr/local/bin/pilfile.py to 755
changing mode of /usr/local/bin/pilprint.py to 755
changing mode of /usr/local/bin/pilfont.py to 755
Successfully installed PIL
Cleaning up...
$>python
Python 2.7.5+ (default, Sep 19 2013, 13:49:51)
[GCC 4.8.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import media
>>>
到此,可以引用media库了。
免责声明:
① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。
② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341