小编Jos*_*ohn的帖子

如何修复ImportError:没有名为packages.urllib3的模块?

我在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
Run Code Online (Sandbox Code Playgroud)

但是,我可以在Python控制台中导入urllib就好了.可能是什么原因?

python urllib2 twill urllib3

14
推荐指数
4
解决办法
5万
查看次数

在HTML表中显示嵌套数组

这是一个简单的问题,我一直试图解决几个小时.我有一个数组包含几个学生的信息和他们在测试中得分的标记.总共有8个科目,每个科目有5个参数.

该数组如下所示:

Array
(
    [Ron] => Array
        (
            [subject1] => Array
                (
                    [test1] => 47
                    [test2] => 86
                    [total] => 133
                    [percentage] => 88.67
                    [status] => Pass
                )
            [pass_count] => 8
            [fail_count] => 0
            [gross_total] => 963
            [gross_percentage] => 80.25

            [...]

            [subject8] => Array
                (
                    [test1] => 48
                    [test2] => 86
                    [total] => 134
                    [percentage] => 89.33
                    [status] => Pass
                )

            [pass_count] => 8
            [fail_count] => 0
            [gross_total] => 900
            [gross_percentage] => 75.50
        )

    [John] => Array
        (
            [subject1] => …
Run Code Online (Sandbox Code Playgroud)

html php arrays nested html-table

5
推荐指数
2
解决办法
1465
查看次数

标签 统计

arrays ×1

html ×1

html-table ×1

nested ×1

php ×1

python ×1

twill ×1

urllib2 ×1

urllib3 ×1