#!/usr/bin/env python
import mechanize
mech = mechanize.Browser()
page = br.open(SchoolRank('KY'))提供:
Traceback (most recent call last):
File "mechanize.py", line 2, in <module>
import mechanize
File "/home/jcress/Documents/programming/schooldig/trunk/mechanize.py", line 12, in <module>
mech = mechanize.Browser()
AttributeError: 'module' object has no attribute 'Browser'我很困惑。我已经安装了2.6和2.7的模块,同样的结果...
发布于 2010-11-21 12:01:07
将您的文件名从mechanize.py改为其他名称。Python正在将您的文件作为模块导入。
https://stackoverflow.com/questions/4236365
复制相似问题