为了账号安全,请及时绑定邮箱和手机立即绑定

求助 :Python3 的Pillow安装好了,但PIL不能用

ptr:py3 apple$ sudo pip3 install Pillow

The directory '/Users/apple/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.

The directory '/Users/apple/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.

Requirement already satisfied: Pillow in /usr/local/lib/python3.6/site-packages

Requirement already satisfied: olefile in /usr/local/lib/python3.6/site-packages (from Pillow)

ptr:py3 apple$ python3

Python 3.6.2 (v3.6.2:5fd33b5926, Jul 16 2017, 20:11:06) 

[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin

Type "help", "copyright", "credits" or "license" for more information.

>>> from Pillow import Image

Traceback (most recent call last):

  File "<stdin>", line 1, in <module>

ModuleNotFoundError: No module named 'Pillow'

>>> from Pil import Image

Traceback (most recent call last):

  File "<stdin>", line 1, in <module>

ModuleNotFoundError: No module named 'Pil'

>>> from PIL import Image

Traceback (most recent call last):

  File "<stdin>", line 1, in <module>

ModuleNotFoundError: No module named 'PIL'



正在回答

2 回答

我也遇到了这种情况,愁了好几天,不是版本对不上,下载的路径也没问题,最后发现是安装过两次TensorFlow,程序在TensorFlow目录下运行的,改成在root就好了https://img1.sycdn.imooc.com//5bd1b91f0001f2f905270215.jpg

0 回复 有任何疑惑可以回复我~

解决了吗?我也遇到这种问题



0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
python进阶
  • 参与学习       255532    人
  • 解答问题       3038    个

学习函数式、模块和面向对象编程,掌握Python高级程序设计

进入课程

求助 :Python3 的Pillow安装好了,但PIL不能用

我要回答 关注问题
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号