为什么我收到错误“无法导入名称扫描仪”当我尝试使用 Python 的 mwclient 模块时?
我正在使用Python 2.5.2(因为mwclient仍然只适用于2.x)。我已将 mwclient 文件夹复制到 /usr/lib/python2.5/site-packages/mwclient 文件夹中,当我运行导入 mwclient 的程序时,我得到以下信息:
Traceback (most recent call last):
File "get_wiki.py", line 2, in <module>
import mwclient
File "/usr/lib/python2.5/site-packages/PIL/__init__.py", line 32, in <module>
File "/usr/lib/python2.5/site-packages/mwclient/client.py", line 8, in <module>
import simplejson
File "/usr/lib/python2.5/site-packages/PIL/__init__.py", line 95, in <module>
File "/home/troy/eo_project/code/3rd_party/mwclient/simplejson/decoder.py", line 6, in <module>
ImportError: cannot import name Scanner
Scanner sees toCE存在于文件decoder.py中,因此我不知道出了什么问题。
我不打算使用 mwclient,但我想要一些可以尽可能解析出 mediawiki 和 HTMl 标签的东西。我正在寻找纯文本来训练我的语言检测程序。
I'm using Python 2.5.2 (because mwclient still only works for 2.x). I've copied the mwclient folder into the /usr/lib/python2.5/site-packages/mwclient folder, and when I run a program that imports mwclient I get this:
Traceback (most recent call last):
File "get_wiki.py", line 2, in <module>
import mwclient
File "/usr/lib/python2.5/site-packages/PIL/__init__.py", line 32, in <module>
File "/usr/lib/python2.5/site-packages/mwclient/client.py", line 8, in <module>
import simplejson
File "/usr/lib/python2.5/site-packages/PIL/__init__.py", line 95, in <module>
File "/home/troy/eo_project/code/3rd_party/mwclient/simplejson/decoder.py", line 6, in <module>
ImportError: cannot import name Scanner
Scanner seens to exist in the file decoder.py, so I can't figure out what could be wrong.
I'm not set on using mwclient, but I want something that will parse out the mediawiki and HTMl tags whenever possible. I'm looking for plain text to train my language detection program.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您已经安装了 simplejson,请删除 mwclient 中的 simplejson 子目录。或者从SVN下载最新版本;它已被修复。
Remove the simplejson subdirectory in mwclient if you already have simplejson installed. Or download the latest version from SVN; it has been fixed.