在Mac上查找和卸载PIL

Cha*_*ith 0 macos python-imaging-library python-2.7 pillow

我想安装Pillow并在许多地方阅读,只有在删除PIL时才能使用.

在某处我安装了PIL,但我无法找到它或记住它是如何安装的.当我通过终端安装东西时,我几乎是一个ctrl + c和ctrl + v家伙,所以我想我在安装它时遇到了一些问题.

我试过了

pip uninstall PIL
easy_install uninstall PIL
brew uninstall PIL
Run Code Online (Sandbox Code Playgroud)

并且没有想法.我甚至找不到任何名为"PIL"的文件和聚光灯.

只是想找到摆脱PIL并安装Pillow的方法,这样我就可以为几百张图片添加文字了.

在El Capitan上运行python 2.7

Mic*_*oom 6

要查找PIL在您的计算机上的位置,请使用Python导入它并将其打印出来:

$ python
Python 2.7.10 (default, Jul 14 2015, 19:46:27)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

>>> import PIL
>>> PIL.__file__
Run Code Online (Sandbox Code Playgroud)

在我的系统上,这给出了:

'/Library/Python/2.7/site-packages/PIL/__init__.pyc'
Run Code Online (Sandbox Code Playgroud)

从中您可以看到site-packages目录所在的位置.现在退出python,进入/Library/Python/2.7/site-packages/(你的确切路径可能与我的不同)并删除文件夹PIL.那应该摆脱它.

 cd /Library/Python/2.7/site-packages/
 sudo rm -rf PIL
Run Code Online (Sandbox Code Playgroud)