pytorch使用问题 SivanLaai 收录于 问题总结2021-10-05 2022-12-11 约 93 字 预计阅读 1 分钟 - 次阅读 目录 1.ModuleNotFoundError: No module named ‘_lzma’Ubuntu(1)安装依赖(2)打开lzma.py(3)修改代码警告本文最后更新于 2022-12-11,文中内容可能已过时。1.ModuleNotFoundError: No module named ‘_lzma’Ubuntu(1)安装依赖1 2 apt-get install liblzma-dev -y pip install backports.lzma(2)打开lzma.py1 vim ~/a/b/python3.7/lzma.py(3)修改代码 1 2 3 4 5 6 7 8 9 10 11 #修改前 from _lzma import * from _lzma import _encode_filter_properties, _decode_filter_properties #修改后 try: from _lzma import * from _lzma import _encode_filter_properties, _decode_filter_properties except ImportError: from backports.lzma import * from backports.lzma import _encode_filter_properties, _decode_filter_propertiesPlease enable JavaScript to view the comments powered by Waline.