How to install PIL in Ubuntu 11.04?

前端 未结 4 1804
死守一世寂寞
死守一世寂寞 2021-02-14 16:27

I see this question asked all over the internet, and I\'ve tried following them all, but I still can\'t get PIL to work.

I tried symbolically linking the zlib, jpeg, et

4条回答
  •  自闭症患者
    2021-02-14 17:14

    Try reinstalling from scratch:

    1. Look for lib/pythonXX/site-packages/PIL. Delete all this directory along with the file PIL.pth. This should completely remove te package.

    2. Unpack the PIL installation files from the *tar.gz you downloaded.

    3. Add the directories where your jpeg library is, with add_directory(...) as you did before. (Use ldconfig -P | grep jpeg to find where the libraries are).

    4. Retry python setup.py build, then python setup.py install. Test it.

    My experience was:

    Not performing step 2 did not rebuild the package. Not performing step 3 was the root cause. Not performing step 1 may have played a part.

    This seems to be a bug in PIL installation, not in Ubuntu's or any distro's package structure.

    And just for the record: it is quite common to have more than one Python version installed on a system, which makes it necessary to install packages manually. Some people have a 2.x with a 3.x for experimenting, shared hostings have 2.5s and applications need a 2.7, just to give two examples.

提交回复
热议问题