擅长:python、mysql、java
<p>我假设您使用的是Python3,并且您的pip已安装且功能正常(根据您的操作系统,您可能需要以管理员身份使用sudo或run命令):</p>
<pre><code>sudo pip uninstall speechrecognition
sudo pip install speechrecognition no-cache-dir
</code></pre>
<p>然后:</p>
<pre><code>sudo pip uninstall pyttsx3
sudo pip install pyttsx3 no-cache-dir
</code></pre>
<p>No cache dir选项将确保您从头开始下载依赖项,以防以前在缓存中下载时出现任何问题。
也可能是您正在使用VENV,或者您的环境变量混乱。
确保您使用的是哪种Python和Pip:</p>
<pre><code>python version
pip -V
</code></pre>