python 用 python -m pip install --upgrade pip 更新 pip 后 还是不行该怎么办

2016-06-18 20:54:05 +08:00
 coddmajes

C:\Users\coddM>pip install pil Collecting pil Could not find a version that satisfies the requirement pil (from versions: ) No matching distribution found for pil You are using pip version 7.1.2, however version 8.1.2 is available. You should consider upgrading via the 'python -m pip install --upgrade pip' command.

C:\Users\coddM>python -m pip install --upgrade pip Requirement already up-to-date: pip in c:\python35\lib\site-packages

18553 次点击
所在节点    Python
10 条回复
lxy
2016-06-18 21:26:53 +08:00
PIL 可换 Pillow
coddmajes
2016-06-18 21:28:56 +08:00
@lxy 主要是 install pillow 后 然后 from PIL import Image 然后就会显示 No module named 'PIL'
infun
2016-06-18 21:34:19 +08:00
@coddmajes install pillow 了都,为啥还 from PIL
coddmajes
2016-06-18 21:38:45 +08:00
@infun 那如果要操作图像 应该怎么办 直接可以用 Image.open 之类的吗,我试了好像不能 麻烦能不能告诉一下, python 主要还是在学过程中
lxy
2016-06-18 21:40:54 +08:00
@coddmajes 这就不清楚了,在我电脑上是可以的。要不只能试试卸载 Pillow 再重装了。
infun
2016-06-18 21:50:33 +08:00
@coddmajes
额,没用过这个模块
查了一下,用法如下
>>> from PIL import Image
>>> im = Image.open("lena.ppm")

http://www.cnblogs.com/apexchu/p/4231041.html
SlipStupig
2016-06-19 07:46:46 +08:00
pip install -U PIL --upgrade
coddmajes
2016-06-19 15:42:55 +08:00
@infun 其实我也知道是这么用 但是就是每次先用>>> from PIL import Image 就会提示 No module named 'PIL', 用 Image.open 之后就会提示 name 'Image' is not defined pip install pil 也不行,好晕


@SlipStupig 这个也试了 依旧是这样
C:\Users\coddM>pip install -U PIL --upgrade
Collecting PIL
Could not find a version that satisfies the requirement PIL (from versions: )
No matching distribution found for PIL
You are using pip version 7.1.2, however version 8.1.2 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
SlipStupig
2016-06-19 16:30:26 +08:00
@coddmajes 先卸载掉 pip 用 easy_install 装 PIL ,然后用 easy_install 装一下 pip
coddmajes
2016-06-19 16:45:59 +08:00
@SlipStupig 好的 感谢 我试试

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/286729

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX