擅长:python、mysql、java
<p><code>TypeError</code>异常声明您试图比较字符串和整数。如果对<code>if verbosity >= 0:</code>的引用是正确的,则意味着<code>verbosity</code>变量是字符串。<br/>
也许您设置了<code>verbosity = '1'</code>,而不是之前的<code>verbosity = 1</code>。在</p>
<p>另一个错误就是它所说的:<code>could not find an executable program to extract format rar; candidates are (rar,unrar,7z)</code>。<br/>
代码期望找到<code>rar</code>、<code>unrar</code>或{<cd9>}(7zip)之一的可执行文件。如果你已经安装了它们,也许你需要告诉<code>patoolib</code>关于它们。在</p>
<p>线</p>
<pre class="lang-py prettyprint-override"><code>rarfile.UNRAR_TOOL = r"C:\Program Files (x86)\UnrarDLL\x64\UnRAR64.dll"
</code></pre>
<p>看起来不错,但如果它不起作用,则可能需要按照<a href="https://stackoverflow.com/a/55577032/9214854">linked answer</a>中的步骤操作,并设置<code>UNRAR_LIB_PATH</code>环境变量。<br/>
这应该解释如何在Windows上设置环境变量:<a href="https://helpdeskgeek.com/windows-10/add-windows-path-environment-variable/" rel="nofollow noreferrer">https://helpdeskgeek.com/windows-10/add-windows-path-environment-variable/</a></p>