<i id='7HX7F'><tr id='7HX7F'><dt id='7HX7F'><q id='7HX7F'><span id='7HX7F'><b id='7HX7F'><form id='7HX7F'><ins id='7HX7F'></ins><ul id='7HX7F'></ul><sub id='7HX7F'></sub></form><legend id='7HX7F'></legend><bdo id='7HX7F'><pre id='7HX7F'><center id='7HX7F'></center></pre></bdo></b><th id='7HX7F'></th></span></q></dt></tr></i><div id='7HX7F'><tfoot id='7HX7F'></tfoot><dl id='7HX7F'><fieldset id='7HX7F'></fieldset></dl></div>

<small id='7HX7F'></small><noframes id='7HX7F'>

    • <bdo id='7HX7F'></bdo><ul id='7HX7F'></ul>

    1. <legend id='7HX7F'><style id='7HX7F'><dir id='7HX7F'><q id='7HX7F'></q></dir></style></legend>

        <tfoot id='7HX7F'></tfoot>
      1. 重新加载模块给出 NameError: name 'reload' is not defined

        Reloading module giving NameError: name #39;reload#39; is not defined(重新加载模块给出 NameError: name reload is not defined)
          • <bdo id='JCpX1'></bdo><ul id='JCpX1'></ul>
            <tfoot id='JCpX1'></tfoot>

              <small id='JCpX1'></small><noframes id='JCpX1'>

              <legend id='JCpX1'><style id='JCpX1'><dir id='JCpX1'><q id='JCpX1'></q></dir></style></legend>
              <i id='JCpX1'><tr id='JCpX1'><dt id='JCpX1'><q id='JCpX1'><span id='JCpX1'><b id='JCpX1'><form id='JCpX1'><ins id='JCpX1'></ins><ul id='JCpX1'></ul><sub id='JCpX1'></sub></form><legend id='JCpX1'></legend><bdo id='JCpX1'><pre id='JCpX1'><center id='JCpX1'></center></pre></bdo></b><th id='JCpX1'></th></span></q></dt></tr></i><div id='JCpX1'><tfoot id='JCpX1'></tfoot><dl id='JCpX1'><fieldset id='JCpX1'></fieldset></dl></div>
                  <tbody id='JCpX1'></tbody>

                  本文介绍了重新加载模块给出 NameError: name 'reload' is not defined的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在尝试重新加载我已经在 Python 3 中导入的模块.我知道您只需要导入一次,再次执行 import 命令不会做任何事情.

                  I'm trying to reload a module I have already imported in Python 3. I know that you only need to import once and executing the import command again won't do anything.

                  执行 reload(foo) 出现此错误:

                  Traceback (most recent call last):
                      File "(stdin)", line 1, in (module)
                      ...
                  NameError: name 'reload' is not defined
                  

                  错误是什么意思?

                  推荐答案

                  reload 是 Python 2 中的内置函数,但不是 Python 3 中的内置函数,因此您看到的错误是预期的.

                  reload is a builtin in Python 2, but not in Python 3, so the error you're seeing is expected.

                  如果您确实必须在 Python 3 中重新加载模块,您应该使用:

                  If you truly must reload a module in Python 3, you should use either:

                  • importlib.reload适用于 Python 3.4 及更高版本
                  • imp.reload适用于 Python 3.0 到 3.3(自 Python 3.4 起已弃用,支持 importlib)

                  这篇关于重新加载模块给出 NameError: name 'reload' is not defined的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  groupby multiple coords along a single dimension in xarray(在xarray中按单个维度的多个坐标分组)
                  Group by and Sum in Pandas without losing columns(Pandas中的GROUP BY AND SUM不丢失列)
                  Is there a way of group by month in Pandas starting at specific day number?( pandas 有从特定日期开始的按月分组的方式吗?)
                  Group by + New Column + Grab value former row based on conditionals(GROUP BY+新列+基于条件的前一行抓取值)
                  Groupby and interpolate in Pandas(PANDA中的Groupby算法和插值算法)
                  Pandas - Group Rows based on a column and replace NaN with non-null values(PANAS-基于列对行进行分组,并将NaN替换为非空值)

                    • <small id='QW75K'></small><noframes id='QW75K'>

                    • <tfoot id='QW75K'></tfoot>
                      <legend id='QW75K'><style id='QW75K'><dir id='QW75K'><q id='QW75K'></q></dir></style></legend>

                          <tbody id='QW75K'></tbody>
                      1. <i id='QW75K'><tr id='QW75K'><dt id='QW75K'><q id='QW75K'><span id='QW75K'><b id='QW75K'><form id='QW75K'><ins id='QW75K'></ins><ul id='QW75K'></ul><sub id='QW75K'></sub></form><legend id='QW75K'></legend><bdo id='QW75K'><pre id='QW75K'><center id='QW75K'></center></pre></bdo></b><th id='QW75K'></th></span></q></dt></tr></i><div id='QW75K'><tfoot id='QW75K'></tfoot><dl id='QW75K'><fieldset id='QW75K'></fieldset></dl></div>

                            <bdo id='QW75K'></bdo><ul id='QW75K'></ul>