【问题记录】ubuntu安装pillow失败
背景:安装一个whl文件,需要pillow支持,不太懂ubuntu下多个版本python环境的操作,只能通过python3和pip3访问3.8版本的python。
解决:
# 分别更新了setuptools、wheel和pip之后,成功安装
pip3 install --upgrade setuptools wheel -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install --upgrade pip -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install Pillow -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
以及刚开始卸载pillow旧版本(一开始有这个报错:cannot import name ‘_imaging’ from ‘PIL’)时也卸载不掉,用的这个命令
#成功卸载的命令
apt remove python3-pil
#以下应该是正常使用时的,记录一下
#看pillow的版本
pip show pillow
#安装、卸载
pip uninstall pillow
pip install pillow
参考文章:
https://www.5axxw.com/questions/simple/vvvjri
https://blog.csdn.net/weixin_45915545/article/details/122940102
https://stackoverflow.com/questions/69624327/failed-building-wheel-for-pillow