我正确安装了PIL但仍然得到No Module Error

时间:2015-03-13 23:16:40

标签: path terminal python-imaging-library homebrew pillow

Grizz-MacBook-Pro:~ Grizz$ cd /usr/local/lib/python2.7/site-packages
Grizz-MacBook-Pro:site-packages Grizz$ ls
PIL             pip-6.0.8-py2.7.egg
Pillow-2.7.0-py2.7.egg-info setuptools-12.0.5-py2.7.egg
PyQt4               setuptools.pth
easy-install.pth        sip.so
hgext               sipconfig.py
homebrew-pillow-nose.pth    sipdistutils.py
mercurial           sitecustomize.py
mercurial-3.3-py2.7.egg-info    sitecustomize.pyc

看起来PIL安装在正确的PATH中,当我在Sublime中使用它时,我得到了:

'Traceback (most recent call last):
  File "/Users/Grizz/Documents/Python Files/Weather APP/WeatherApp.py",     line 4, in <module>
    from PIL import Image
ImportError: No module named PIL
[Finished in 0.1s with exit code 1]
[shell_cmd: python -u "/Users/Grizz/Documents/Python Files/Weather     APP/WeatherApp.py"]
[dir: /Users/Grizz/Documents/Python Files/Weather APP]
[path: /usr/bin:/bin:/usr/sbin:/sbin]

我希望弄清楚如何更改PIL路径以将其修改为我的系统python路径,以便我可以在我的解释器中运行它,或者以正确的方式卸载和重新下载PIL。

我是Mac OS新手,直到现在才能解决大部分问题。我猜它是因为我跑掉了我的系统Python 2.7而不是一个brew installeld 2.7 ......有人可以引导我完成这个吗?

0 个答案:

没有答案