2024-09-22 22:34:07 发布
网友
我已经导入了python3.4.4中的“langdetect”库。这在Python3.4.4shell中是成功的,但是当我创建一个新的.py文件时,它就不能成功地工作了。它显示ImportError:无法导入名称“detect”。我如何解决这个问题。在
看起来您已经将自己的文件命名为langdetect.py,然后尝试import langdetect。这使得它试图导入自己。将文件重命名为其他文件,如testdetect.py。在
langdetect.py
import langdetect
testdetect.py
看起来您已经将自己的文件命名为
langdetect.py
,然后尝试import langdetect
。这使得它试图导入自己。将文件重命名为其他文件,如testdetect.py
。在相关问题 更多 >
编程相关推荐