擅长:python、mysql、java
<p>脑海中浮现出三种可能性(一种是@abarner的):</p>
<ul>
<li><code>pyspark.hbase</code>有一个<code>__all__</code>,而您尝试使用的类不在其中</li>
<li><code>pyspark.hbase</code>没有<code>__all__</code>,但类名/函数等以<code>_</code>开头。在</li>
<li>重新加载后不会重新创建类实例,因此它们仍然绑定到旧模块的类。在</li>
</ul>
<p><code>__all__</code>用作模块定义其官方API的一种方式。它还用于提供在发出<code>from ... import *</code>时要导入的名称列表。如果未定义<code>__all__</code>,那么在该模块上使用<code>from ... import *</code>时,将加载该模块中任何不以<code>_</code>开头的名称。在</p>
<p>无论是否定义了<code>__all__</code>,您始终可以通过直接请求来显式加载模块中定义的任何名称:</p>
<pre><code>from xyz import _private
</code></pre>
<p>{12>将加载到你的命名空间中。在</p>