完美解决导入from PIL import image出现错误的问题
2023-09-14 09:09:14 时间
1)运行此命令:
import sys
from PIL import Image
sys.modules['Image'] = Image
2)在笔记本中运行以下两行,以确保它们正确指向同一目录(如果不是因为你的PIL旧库弄乱了Pillow库)
from PIL import Image
print(Image.__file__)
import Image
print(Image.__file__)
3)如果它正常工作并且两个导入打印指向同一个python3目录,那么继续.
如果不,转到您的操作系统控制台和您的conda环境(确保您在所需的conda环境中工作):
conda uninstall PIL
conda uninstall Pillow
conda install Pillow
您现在应该已经成功安装了Pillow的所有库,并解决了PIL的任何问题.
相关文章
- FBX导入错误 :ImportFBX Errors:
- 非编程人学Python,要注意哪些隐秘的错误认知?
- 【Oracle】TNS-12154 错误解析
- tar解压包的时候出现错误 gzip: stdin: not in gzip format
- 用SYS本地登录或远程登录引起ORA-01031错误
- Spartacus 4.3.x 版本导入 Cart 到 App Module 构造函数的错误消息
- docker run hello-world 遇到错误消息 - error during connect
- System.ServiceModel.CommunicationException: 接收HTTP 响应时发生错误
- 如何修复 SAP UI5 aggregation with cardinality 0..1 相关的错误消息
- 如何分析SAP Fiori运行时报出的HTTP Request Failed错误消息
- 非编程人学Python,要注意哪些隐秘的错误认知?
- pycharm导入模块的时候遇到的两个错误
- win7 64位iis发生错误w3wp.exe解决方法
- Eclipse正在使用Ant扑灭Android数据包错误的解决方案 – Perhaps JAVA_HOME does not point to the JDK
- InstallShield Build错误:Internal build error 6041
- Android工程导入时常见的错误解决方法