我在一台Ubuntu机器上运行Python 2.7.6。当我在终端中运行twill-sh(Twill是用于测试网站的浏览器)时,我遇到以下问题:
Traceback (most recent call last):
File "dep.py", line 2, in <module>
import twill.commands
File "/usr/local/lib/python2.7/dist-packages/twill/__init__.py", line 52, in <module>
from shell import TwillCommandLoop
File "/usr/local/lib/python2.7/dist-packages/twill/shell.py", line 9, in <module>
from twill import commands, parse, __version__
File "/usr/local/lib/python2.7/dist-packages/twill/commands.py", line 75, in <module>
browser = TwillBrowser()
File "/usr/local/lib/python2.7/dist-packages/twill/browser.py", line 31, in __init__
from requests.packages.urllib3 import connectionpool as cpl
ImportError: No module named packages.urllib3
然而,在Python控制台中我可以很好地导入urllib。可能的原因是什么?
requires=['requests']
。 - Eli