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
1
lxy 2016-06-18 21:26:53 +08:00
PIL 可换 Pillow
|
2
coddmajes OP @lxy 主要是 install pillow 后 然后 from PIL import Image 然后就会显示 No module named 'PIL'
|
4
coddmajes OP @infun 那如果要操作图像 应该怎么办 直接可以用 Image.open 之类的吗,我试了好像不能 麻烦能不能告诉一下, python 主要还是在学过程中
|
6
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 |
7
SlipStupig 2016-06-19 07:46:46 +08:00
pip install -U PIL --upgrade
|
8
coddmajes OP @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. |
9
SlipStupig 2016-06-19 16:30:26 +08:00 1
@coddmajes 先卸载掉 pip 用 easy_install 装 PIL ,然后用 easy_install 装一下 pip
|
10
coddmajes OP @SlipStupig 好的 感谢 我试试
|