卸载从源构建的PIL

时间:2013-06-18 12:55:17

标签: python linux python-imaging-library

我使用本教程安装PIL。现在,我想卸载它并在其位置安装pillow

mkdir -p ~/src ~/lib/python2.7
cd ~/src
wget http://effbot.org/media/downloads/PIL-1.1.7.tar.gz
tar zxf PIL-1.1.7.tar.gz
cd PIL-1.1.7
python2.7 setup.py build_ext -i
python2.7 setup.py install

如何卸载PIL?

PS:我没有在我的任何版本中安装PIL。这是一个全球性的安装。不过,我正在为所有项目使用virtualenvs。

2 个答案:

答案 0 :(得分:2)

从Ubuntu 14.04开始工作,但这应该是普遍适用的。当我安装时,我打电话给以下人员:

sudo python setup.py install

我注意到以下描述默认安装的语句:

...
Installing pildriver.py script to /usr/local/bin
Installing viewer.py script to /usr/local/bin
Installing gifmaker.py script to /usr/local/bin
Installing painter.py script to /usr/local/bin
Installing pilfont.py script to /usr/local/bin
Installing pilprint.py script to /usr/local/bin
Installing pilconvert.py script to /usr/local/bin
Installing enhancer.py script to /usr/local/bin
Installing pilfile.py script to /usr/local/bin
Installing createfontdatachunk.py script to /usr/local/bin
Installing explode.py script to /usr/local/bin
Installing thresholder.py script to /usr/local/bin
Installing player.py script to /usr/local/bin

Installed /usr/local/lib/python2.7/dist-packages/Pillow-3.4.2-py2.7-linux-x86_64.egg

所以,我运行了以下内容:

cd /usr/local/bin
sudo rm -f pildriver.py viewer.py gifmaker.py painter.py pilfont.py pilprint.py pilconvert.py enhancer.py pilfile.py createfontdatachunk.py explode.py thresholder.py player.py
sudo rm -f /usr/local/lib/python2.7/dist-packages/Pillow-3.4.2-py2.7-linux-x86_64.egg

通过apt-get重新安装Pillow(python-imaging)后,一切运行正常。

答案 1 :(得分:0)

您必须手动删除复制到系统的所有文件。您还需要编辑一些文本文件并手动删除对该文件的引用。

没有卸载功能。下次使用您的发行版的包管理系统。