python - python 3.4.4中的langdetect库导入错误
问题描述
我在 python 3.4.4 中导入了“langdetect”库。这在 python 3.4.4 shell 中成功运行,但是当我创建一个新的 .py 文件时,它无法成功运行。它表明 ImportError: cannot import name 'detect'。我如何解决这个问题。
解决方案
看起来您已经命名了自己的文件langdetect.py
,然后尝试将import langdetect
. 这使它尝试导入自己。将您的文件重命名为其他名称,例如testdetect.py
.
推荐阅读
- javascript - 如何在引导程序中添加列表
- 使用 JavaScript
- go - 将位映射到 int
- rxjs - rxjs switchMap 需要返回订阅的 observable
- media-player - gstreamer rtsp播放过程理解
- python - 值错误:。使用 a.empty、a.bool()、a.item()、a.any() 或 a.all()。在调用函数时
- ios - UIPickerView 放置在视图顶部
- wordpress - 如何在woo-commerce购物车页面和结帐页面显示全额价格格式
- javascript - 为什么我的 Javascript 变量没有初始化?
- angular - 重复的产品正在添加到 Ionic App 的愿望清单页面
- excel - 使用双显示器时如何调用“Workbook_WindowActivate”?