擅长:python、mysql、java
<p>首先,确保python列在您的路径中,我注意到这可能是一个问题。在</p>
<p>下一步检查以确保没有超过windows路径长度限制,您可能需要将虚拟env移动到包含较少字符的文件夹中。在</p>
<p>第三,通过运行确保您拥有最新版本的PIP</p>
<pre><code>python -m pip install -U pip setuptools
</code></pre>
<>请确保安装了C++,正确的版本,这会导致问题。在</p>
<p>最终,当我遇到这个问题时,对我有用的是安装以前的版本:</p>
<p>pip install mysqlclient==1.3.4</p>
<p>在发现这个方法有效之前,我发现我还可以使用oracle mysql连接器。。。在</p>
<p>此外,还可以直接从以下位置下载二进制文件:
<a href="http://www.lfd.uci.edu/~gohlke/pythonlibs/#mysqlclient" rel="nofollow noreferrer">http://www.lfd.uci.edu/~gohlke/pythonlibs/#mysqlclient</a></p>
<p>选择正确的python版本和windows版本,并将其解压缩到项目文件夹中。如果您运行的是python 3.5x64,您需要这个:
<a href="http://www.lfd.uci.edu/~gohlke/pythonlibs/dn4ksi39/mysqlclient-1.3.9-cp35-cp35m-win_amd64.whl" rel="nofollow noreferrer">mysqlclient-1.3.9-cp35-cp35m-win_amd64.whl</a></p>