卸载预安装的 PIL

卸载预安装的 PIL

我想安装 Pillow,但是根据 Pillow 的文档,我必须PIL先删除,它似乎是在 Ubuntu 13.10 中预装的。

最好的方法是什么?

答案1

卸载 pil 最简单的方法是使用点子

sudo pip uninstall pil

然后使用 pip 安装枕头:

sudo pip install pillow

(看这里用于安装 pip)

答案2

请尝试以下操作:

完全移除 PIL/枕头 (2.7 和 3.5):

$ sudo -H pip uninstall pillow
-> Successfully uninstalled Pillow-3.1.2
$ sudo -H pip3 uninstall pillow
-> Cannot uninstall requirement pillow, not installed

彻底删除 pip 和 pip3:

$ which pip
/usr/local/bin/pip

$ /usr/local/bin/pip uninstall pip
$ sudo apt-get remove python-pip 

删除 Egg(从 easy_install 中):

安装 pip 和 pip3:

$ sudo apt-get install python-pip
$ sudo apt-get install python3-pip

$ sudo easy_install pip     <- Installs to different directory (egg)
$ sudo easy_install pip3    <- Installs to different directory (egg)

安装枕头(2.7和3.5):

sudo -H pip3 install pillow
-> Installed Pillow-4.1.1-cp27-cp27mu-manylinux1_x86_64.whl
sudo -H pip install pillow
-> Requirement already satisfied

$ sudo easy_install Pillow
Searching for Pillow
Best match: Pillow 4.1.1
Adding Pillow 4.1.1 to easy-install.pth file

Using /usr/local/lib/python2.7/dist-packages
Processing dependencies for Pillow
Finished processing dependencies for Pillow

$ sudo pip3 install Pillow
Requirement already satisfied: Pillow in ./.local/lib/python2.7/site-packages

相关内容