How to fix ImportError: No module named packages.urllib3?

后端 未结 5 1696
既然无缘
既然无缘 2020-12-11 01:09

I\'m running Python 2.7.6 on an Ubuntu machine. When I run twill-sh (Twill is a browser used for testing websites) in my Terminal, I\'m getting the following:

5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-11 02:00

    There is a difference between the standard urllib and urllib2 and the third-party urllib3.

    It looks like twill does not install the dependencies so you have to do it yourself. Twill depends on requests library which comes with and uses urllib3 behind the scenes. You also need lxml and cssselect libraries.

    You can install them on terminal as follows:

    pip install requests

    pip install lxml

    and

    pip install cssselect

提交回复
热议问题