[英]How do I manually uninstall PIL from OSX (snow leopard)
I managed to manually install PIL on my macbook (without package managers, please don't answer use xcode, as I want to do this manually). 我设法在我的macbook上手动安装PIL(没有包管理器,请不要回答使用xcode,因为我想手动执行此操作)。
Unwanted answers: 不需要的答案:
The answer I am looking for could be: 我正在寻找的答案可能是:
I used these commands amongst others: 我使用过这些命令:
python setup.py build
sudo python setup.py install
And I got this result: 我得到了这个结果:
--------------------------------------------------------------------
PIL 1.1.7 SETUP SUMMARY
--------------------------------------------------------------------
version 1.1.7
platform darwin 2.6.1 (r261:67515, Jun 24 2010, 21:47:49)
[GCC 4.2.1 (Apple Inc. build 5646)]
--------------------------------------------------------------------
--- TKINTER support available
--- JPEG support available
--- ZLIB (PNG/ZIP) support available
*** FREETYPE2 support not available
*** LITTLECMS support not available
--------------------------------------------------------------------
To add a missing option, make sure you have the required
library, and set the corresponding ROOT variable in the
setup.py script.
My big picture problem (which I will address in another question) is that I need FREETYPE2 support, but the first step will be to uninstall PIL correctly using either a python script or the terminal. 我的大图片问题(我将在另一个问题中解决)是我需要FREETYPE2支持,但第一步是使用python脚本或终端正确卸载PIL。 My system has an intel processor and is OSX version 10.6.8
我的系统有一个intel处理器,是OSX版本10.6.8
Thanks 谢谢
There is no simple script you can run that will do this in all cases. 在任何情况下都没有可以运行的简单脚本。 (That's a large part of the reason
pip
was invented…) (这是
pip
发明的原因很大一部分......)
Apple's pre-installed Python 2.6 sets its default site-packages directory to: Apple预安装的Python 2.6将其默认的site-packages目录设置为:
/Library/Python/2.6/site-packages
… and its scripts directory to: ...及其脚本目录:
/usr/local/bin
So, sudo python setup.py install
will install everything to those two directories. 所以,
sudo python setup.py install
会将所有内容安装到这两个目录中。
If you're using a third-party Python, or have changed the configuration, the locations may be elsewhere, so I'll refer to these as ${sitedir} and ${bindir} below. 如果您使用的是第三方Python,或者已经更改了配置,则位置可能位于其他地方,因此我将在下面将其称为$ {sitedir}和$ {bindir}。
Exactly what you get installed depends on which version of PIL or pillow you installed. 您安装的具体取决于您安装的PIL或枕头版本。 With the last few versions of PIL, it should be:
使用PIL的最后几个版本,应该是:
Depending on the way you have setuptools
and/or distribute
installed, you may not have the egg-info
directory. 根据安装
setuptools
和/或distribute
安装的方式,您可能没有egg-info
目录。 With Pillow, the egg-info file is named Pillow-xyz-py2.6.egg-info
. 使用Pillow,egg-info文件名为
Pillow-xyz-py2.6.egg-info
。 With older PIL, you may have only four scripts instead of five. 使用较旧的PIL,您可能只有四个脚本而不是五个脚本。
Anyway, if you have the egg-info
directory, look at the installed-files.txt
inside of it. 无论如何,如果你有
egg-info
目录,请查看其中的installed-files.txt
。 All of those files, relative to the egg-info
directory itself, are what got installed. 所有这些文件,相对于
egg-info
目录本身,都是安装的。 However, just passing that file to rm -rf
will leave behind any directories automatically created along the way—most notably, the ${sitedir}/PIL
package directory. 但是,只是将该文件传递给
rm -rf
将留下任何自动创建的目录 - 最值得注意的是${sitedir}/PIL
包目录。 You could write a script that removes each file, then removes any directories that are left empty as a result… but that could be a bad idea if, eg, you happen to have nothing else in /usr/local/bin
. 您可以编写一个删除每个文件的脚本,然后删除任何留空的目录......但是,如果您碰巧在
/usr/local/bin
没有其他任何内容,那么这可能是一个坏主意。 So, it's useful as a guide to drive or double-check manual cleanup, but it won't make everything automatic. 因此,它可以作为驱动或仔细检查手动清理的指南,但它不会使一切都自动化。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.