V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
coddmajes
V2EX  ›  Python

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

  •  1
     
  •   coddmajes · 2016-06-18 20:54:05 +08:00 · 18428 次点击
    这是一个创建于 2874 天前的主题,其中的信息可能已经有所发展或是发生改变。

    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

    10 条回复    2016-06-19 16:45:59 +08:00
    lxy
        1
    lxy  
       2016-06-18 21:26:53 +08:00
    PIL 可换 Pillow
    coddmajes
        2
    coddmajes  
    OP
       2016-06-18 21:28:56 +08:00
    @lxy 主要是 install pillow 后 然后 from PIL import Image 然后就会显示 No module named 'PIL'
    infun
        3
    infun  
       2016-06-18 21:34:19 +08:00 via Android
    @coddmajes install pillow 了都,为啥还 from PIL
    coddmajes
        4
    coddmajes  
    OP
       2016-06-18 21:38:45 +08:00
    @infun 那如果要操作图像 应该怎么办 直接可以用 Image.open 之类的吗,我试了好像不能 麻烦能不能告诉一下, python 主要还是在学过程中
    lxy
        5
    lxy  
       2016-06-18 21:40:54 +08:00
    @coddmajes 这就不清楚了,在我电脑上是可以的。要不只能试试卸载 Pillow 再重装了。
    infun
        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
    SlipStupig
        7
    SlipStupig  
       2016-06-19 07:46:46 +08:00
    pip install -U PIL --upgrade
    coddmajes
        8
    coddmajes  
    OP
       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
        9
    SlipStupig  
       2016-06-19 16:30:26 +08:00   ❤️ 1
    @coddmajes 先卸载掉 pip 用 easy_install 装 PIL ,然后用 easy_install 装一下 pip
    coddmajes
        10
    coddmajes  
    OP
       2016-06-19 16:45:59 +08:00
    @SlipStupig 好的 感谢 我试试
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2086 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 01:47 · PVG 09:47 · LAX 18:47 · JFK 21:47
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.