Py-*_*ser 0 pip python-imaging-library python-3.7
我正在尝试修复对 Image 模块的调用(直到现在我才知道这个 Python 成像库),并且我需要升级Pillow,因为 中的文件/usr/lib/python3/dist-packages/PIL/Image.py声明版本为 1.1.7,但有更新的版本可用。
$ sudo pip3 install Pillow
[sudo] password di user:
The directory '/home/user/.cache/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 '/home/user/.cache/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 (use --upgrade to upgrade): Pillow in /usr/lib/python3/dist-packages
You are using pip version 8.1.1, however version 19.2.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
You are using pip version 8.1.1, however version 19.2.1 is available.
Run Code Online (Sandbox Code Playgroud)
但是,当我尝试升级时:
user:~/Downloads$ pip3 install --upgrade pip
Requirement already up-to-date: pip in /home/user/.local/lib/python3.7/site-packages (19.2.1)
Run Code Online (Sandbox Code Playgroud)
我很困惑,我错过了什么?
第一条消息告诉您有 pip 可用的升级,而不是 Pillow。
第一个命令使用sudo. 第二个没有。sudo 路径中的 pip 必须与用户路径中的不同。
不建议sudo与pip一起使用。而是使用--user开关。
另外,中的1.1.7版本Image.py是PIL的版本,Pillow是PIL的一个fork。Pillow 本身有另一个版本号,1.1.7 版本正在从 Pillow 中删除。
所以不要使用sudo pip3 ...and 而是:
pip3 install --user --upgrade pip
pip3 install --user --upgrade pillow
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
8927 次 |
| 最近记录: |