AttributeError: module ‘torchtext‘ has no attribute ‘legacy‘

问题:

使用torchtext.data 或者 torchtext.legacy 时报错如下:

bash 复制代码
AttributeError: module 'torchtext' has no attribute 'legacy'

AttributeError: module 'torchtext' has no attribute 'data'

解决办法:

bash 复制代码
pip install torchtext==0.6.0  --no-dependencies
相关推荐
weixin_46244623几秒前
【原创实践】Python 将 Markdown 文件转换为 Word(docx)完整实现
开发语言·python·word
mzhan017几秒前
[晕事]今天做了件晕事98,把openssl-libs 强制删掉了
linux·网络·晕事·openssl-libs
企微自动化4 分钟前
企业微信二次开发:深度解析外部群主动推送的实现路径
java·开发语言·企业微信
我的offer在哪里10 分钟前
c++的回调函数
开发语言·c++
智航GIS11 分钟前
ArcGIS大师之路500技---048计算流水号
python·arcgis
一棵开花的树,枝芽无限靠近你13 分钟前
【face-api.js】2️⃣ NetInput - 神经网络输入封装类
开发语言·javascript·神经网络
yongche_shi13 分钟前
第九十九篇:Python在其他领域的应用:游戏开发、物联网、AIoT简介
开发语言·python·物联网·游戏开发·aiot
知识分享小能手14 分钟前
Ubuntu入门学习教程,从入门到精通, Ubuntu 22.04 的软件包管理 —— 全面详解(9)
linux·学习·ubuntu
froginwe1114 分钟前
Node.js 回调函数
开发语言
期待のcode17 分钟前
Java中的继承
java·开发语言