Python 3.x python mechanize导入在Python2.x中失败

Python 3.x python mechanize导入在Python2.x中失败,python-3.x,python-2.7,pip,mechanize,mechanize-python,Python 3.x,Python 2.7,Pip,Mechanize,Mechanize Python,在Mechanize中使用“浏览器”时,Mechanize不能与Python2.x一起使用 import re from mechanize import Browser br = mechanize.Browser() br.open("https://en.wikipedia.org/wiki/Whey_protein") response1 = br.follow_link(text_regex=r"protein\s*shop", nr=1) assert br.viewing_ht

在Mechanize中使用“浏览器”时,Mechanize不能与Python2.x一起使用

import re
from mechanize import Browser

br = mechanize.Browser()
br.open("https://en.wikipedia.org/wiki/Whey_protein")

response1 = br.follow_link(text_regex=r"protein\s*shop", nr=1)
assert br.viewing_html()
print(br.title())
print(response1.geturl())
print(response1.info())
print(response1.read()) )
回溯(最近一次呼叫最后一次):

文件“C:\Users\test\mechanize_bt.py”,第2行,在

从mechanize导入浏览器

导入错误:无法导入名称浏览器


请发布完整的回溯您的脚本所在的文件夹中是否有名为mechanize.py的本地文件?