V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
tooweakchen
V2EX  ›  Python

使用 PIL 时,显示编译不支持支持 jpeg png,卸载了几次,百度找了方法,但是重装还是出现问题

  •  
  •   tooweakchen · 2015-08-11 17:18:31 +08:00 · 3704 次点击
    这是一个创建于 3180 天前的主题,其中的信息可能已经有所发展或是发生改变。

    首先的环境是 ubuntu14.04 64位 python2.7
    按照这个http://cn-popeye.iteye.com/blog/1236691博客里面的方法重装,出现error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    这个错误.
    有什么其他安装方法吗?弄了两天了.

    14 条回复    2015-08-25 10:14:37 +08:00
    tdifg
        1
    tdifg  
       2015-08-11 17:20:44 +08:00   ❤️ 1
    当年装这个也出过这个错,貌似是少个啥库,具体忘了……
    lj0014
        2
    lj0014  
       2015-08-11 17:23:30 +08:00   ❤️ 1
    yum install libjpeg-devel
    wget http://effbot.org/media/downloads/Imaging-1.1.7.tar.gz
    tar -xzvf Imaging-1.1.7.tar.gz
    cd Imaging-1.1.7
    python setup.py install
    ------
    参考下,我以前安装记录的
    tooweakchen
        3
    tooweakchen  
    OP
       2015-08-11 17:24:46 +08:00
    @tdifg 装了我两天了
    tooweakchen
        4
    tooweakchen  
    OP
       2015-08-11 17:24:59 +08:00
    @lj0014 我试试看
    archsocks
        5
    archsocks  
       2015-08-11 17:25:24 +08:00
    少dev库。

    sudo apt-get install libjpeg8-dev zlib1g-dev libfreetype6-dev libwebp-dev libopenjpeg-dev
    tooweakchen
        6
    tooweakchen  
    OP
       2015-08-11 17:27:14 +08:00
    @lj0014
    执行sudo yum install libjpeg-devel ,出现下面问题
    没有已启用的仓库。
    执行 "yum repolist all" 查看您拥有的仓库。
    您可以用 yum-config-manager --enable <仓库名> 来启用仓库
    14
        7
    14  
       2015-08-11 17:27:53 +08:00
    用 Pillow,PIL已经好久没更新, Pillow是继任者,它的安装文档非常详细: https://pillow.readthedocs.org/installation.html

    你(Ubuntu 14.04 LTS)可能需要这几个命令:
    sudo apt-get install python-dev python-setuptools
    sudo apt-get install libtiff5-dev libjpeg8-dev zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev python-tk
    sudo pip install Pillow
    tooweakchen
        8
    tooweakchen  
    OP
       2015-08-11 17:42:35 +08:00
    @14
    最后一句sudo pip install Pillow时,出现下面,啥问题啊
    Requirement already satisfied (use --upgrade to upgrade): Pillow in ./.local/lib/python2.7/site-packages
    Cleaning up...
    14
        9
    14  
       2015-08-11 17:45:10 +08:00   ❤️ 1
    @tooweakchen 提示你已经安装过pillow了,先运行一次pip uninstall pillow再重新安装
    tooweakchen
        10
    tooweakchen  
    OP
       2015-08-11 18:17:22 +08:00
    @14 多谢啊,你的方法成功了.感谢
    kokdemo
        11
    kokdemo  
       2015-08-11 18:25:08 +08:00
    pil 各种坑啊……
    这两天用pil生成优惠券的图片,结果原图是300的dpi,生成出来只有72……

    在网上找了很多方法试了都没有用……
    aisk
        12
    aisk  
       2015-08-11 19:27:59 +08:00
    @tooweakchen 也可以直接 pip install pillow -U
    poke707
        13
    poke707  
       2015-08-12 23:54:55 +08:00 via Android
    需要注意,安装dev库之后再在pip install可能会受缓存影响而未重新编译
    hasdream
        14
    hasdream  
       2015-08-25 10:14:37 +08:00
    apt-get install python-dev -y 安装 python 开发包
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   985 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 20:58 · PVG 04:58 · LAX 13:58 · JFK 16:58
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.