pip install PIL -E TICKETS-1 - No JPEG/PNG support

前端 未结 3 1456
栀梦
栀梦 2020-12-08 20:35

I\'m using Ubuntu and VitualEnv for my Django project.

I have PIL library installed using Synaptic Package Manager and it is working fine. But when I create an Vitru

相关标签:
3条回答
  • 2020-12-08 20:46

    A solution that seems to work for us (as of PIL 1.7.7) is to uninstall PIL first and then Pillow and then pip install pillow --upgrade. Of course you need to have libjpeg8-dev installed.

    0 讨论(0)
  • 2020-12-08 20:47

    This thread on ubuntu forums covers this topic.

    0 讨论(0)
  • 2020-12-08 21:01

    And just in case, if you are using virtualenv, you don't need to need to create system-wide symlinks, here is the universal workaround that works on any architecture:

    ln -s /usr/lib/`dpkg-architecture -qDEB_HOST_MULTIARCH`/libz.so $VIRTUAL_ENV/lib/
    ln -s /usr/lib/`dpkg-architecture -qDEB_HOST_MULTIARCH`/libfreetype.so $VIRTUAL_ENV/lib/
    ln -s /usr/lib/`dpkg-architecture -qDEB_HOST_MULTIARCH`/libjpeg.so $VIRTUAL_ENV/lib/
    

    And you need to execute these line inside virtualenv activated shell session, symlinks will be created inside your virtualenv lib directory.

    Command dpkg-architecture -qDEB_HOST_MULTIARCH is being used to detect main system libs directory (uname -i is not reliable). And environment variable $VIRTUAL_ENV is set by virtualenv activate script.

    0 讨论(0)
提交回复
热议问题