当前位置:网站首页>pillow的原因ImportError: cannot import name ‘PILLOW_VERSION‘ from ‘PIL‘,如何安装pillow<7.0.0
pillow的原因ImportError: cannot import name ‘PILLOW_VERSION‘ from ‘PIL‘,如何安装pillow<7.0.0
2022-07-26 05:03:00 【Redamancy06】
File “D:\Asoftware\Anaconda3\envs\3d_photo_stylization\lib\site-packages\torchvision\transforms\functional.py”, line 5, in
from PIL import Image, ImageOps, ImageEnhance, PILLOW_VERSION
ImportError: cannot import name ‘PILLOW_VERSION’ from ‘PIL’ (D:\Asoftware\Anaconda3\envs\3d_photo_stylization\lib\site-packages\PIL_init_.py)
报错解释:torchvision在运行时要调用PIL模块,调用PIL模块的PILLOW_VERSION函数。但是PILLOW_VERSION在Pillow 7.0.0之后的版本被移除了,Pillow 7.0.0之后的版本使用__version__函数代替PILLOW_VERSION函数。
如何安装pillow<7.0.0
首先进入网站找到适合自己对应电脑版本的pillow包https://pypi.org/simple/pillow/

6.2.2代表Pillow-版本,cp37代表python3.7版本,win_amd64是windows版本下64位的电脑
方法一.卸载PIL模块,重新安装,安装7.0.0之前的版本,我这里安装的6.2.2版本,使用的命令是
pip install pillow==6.2.2

方法二:使用from PIL import Image, ImageOps, ImageEnhance, version 替换文件中from PIL import Image, ImageOps, ImageEnhance,PILLOW_VERSION这句。
说白了就是用__version__ 替换原来的PILLOW_VERSION。点击保存即可。
然后就没有那个报错项了
边栏推荐
- 【pytorch】torch1.8.1安装、查看torch版本、GPU是否可用
- 一次线上事故,我顿悟了异步的精髓
- JVM第六讲:线上环境 FGC 频繁,如何解决?
- 推荐12个免费查找文献的学术网站,建议点赞、收藏!
- How many holes have you stepped on in BigDecimal?
- JVM第五讲:纵横数据如何应对洪峰推送
- JVM Lecture 6: how to solve the frequent FGC in online environment?
- Unnamed Article 33
- [Luogu] p3919 [template] persistent segment tree 1 (persistent array)
- C语言——字符串函数,内存函数集锦以及模拟实现
猜你喜欢

Database startup message: ora-29702: error occurred in cluster group service

科技论文翻译,俄语文档的语法有何特点

Two ways to create MySQL database

Rman-06031 cannot convert database keywords

There was an unexpected error (type=Method Not Allowed, status=405).记录报错

Google Emoji guessing game helps parents guide their children to surf the Internet safely

提高shuffle操作中的reduce并行度

擅长C(暑假每日一题 6)

C语言——字符串函数,内存函数集锦以及模拟实现

未来大气污染变化模拟
随机推荐
Customer service relationship management based on SQL net enterprise messenger enterprise communications
基于通用优化软件GAMS的数学建模和优化分析
奥特学园ROS笔记--6
【ACWing】1268. 简单题
@Autowired注解的原理
can 串口 can 232 can 485 串口转CANbus总线网关模块CAN232/485MB转换器CANCOM
安装NCCL\mpirun\horovod\nvidia-tensorflow(3090Ti)
Switch and router technology: dynamic routing protocol, rip routing protocol and OSPF routing protocol
The first open source MySQL native HTAP database in China will be released soon! Look at the three highlights first, limited to the surrounding areas, waiting for you~
黑吃黑?男子破解赌博网站漏洞,每月“薅羊毛”10多万元
遥感、GIS和GPS技术在水文、气象、灾害、生态、环境及卫生等领域中的应用
有ggjj看看这个问题没,是否缓存导致跨域问题?
【Leetcode】493. Reverse Pairs
columns in GROUP BY clause; this is incompatible with sql_ mode=only_ full_ group_ By mysql8.0 solution
[acwing] 1268. Simple questions
AXI协议(5):AXI协议的burst机制
How many holes have you stepped on in BigDecimal?
The elderly who claim alimony from other children after being supported by their widowed daughter-in-law should be supported
Study of const of constant function
Redis过期删除策略和内存淘汰策略