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

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

      <legend id='y1MVT'><style id='y1MVT'><dir id='y1MVT'><q id='y1MVT'></q></dir></style></legend>

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

        Django - 安装 mysqlclient 错误:需要 mysqlclient 1.3.13 或更新版本;你有 0.

        时间:2023-06-25
      1. <i id='VTqKl'><tr id='VTqKl'><dt id='VTqKl'><q id='VTqKl'><span id='VTqKl'><b id='VTqKl'><form id='VTqKl'><ins id='VTqKl'></ins><ul id='VTqKl'></ul><sub id='VTqKl'></sub></form><legend id='VTqKl'></legend><bdo id='VTqKl'><pre id='VTqKl'><center id='VTqKl'></center></pre></bdo></b><th id='VTqKl'></th></span></q></dt></tr></i><div id='VTqKl'><tfoot id='VTqKl'></tfoot><dl id='VTqKl'><fieldset id='VTqKl'></fieldset></dl></div>
            <bdo id='VTqKl'></bdo><ul id='VTqKl'></ul>
              <tbody id='VTqKl'></tbody>
            <tfoot id='VTqKl'></tfoot>

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

              <legend id='VTqKl'><style id='VTqKl'><dir id='VTqKl'><q id='VTqKl'></q></dir></style></legend>

                1. 本文介绍了Django - 安装 mysqlclient 错误:需要 mysqlclient 1.3.13 或更新版本;你有 0.9.3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我浏览了论坛,但找不到答案,甚至找不到任何相关文档.试图重新创建一个像 www.testandtrack.io 的网站

                  I've trawled the forums but cannot find an answer or even any documentation on this. Trying to re-create a site like www.testandtrack.io

                  运行命令:

                  python manage.py inspectdb
                  

                  我收到错误:

                  mysqlclient 1.3.13 or newer is required; you have 0.9.3
                  

                  我已经尝试了所有建议的修复,包括:- 升级 pip- 使用命令 pip install mysqlclient-1.4.2-cp37-cp37m-win32.whl 安装不同的轮子(32 位而不是 64 位),即 mysqlclient-1.4.2-cp37-cp37m-win32.whl(这在没有一个错误,但没有完成所需的工作!)

                  I have tried all the suggested fixes including: -upgrading pip -installing a different wheel (32 bit instead of 64), namely mysqlclient-1.4.2-cp37-cp37m-win32.whl with the command pip install mysqlclient-1.4.2-cp37-cp37m-win32.whl (this works fine without an error but doesn't do the job required!)

                  我的目标是简单地将旧版 mysql 数据库(在 XAMPP 和 myphpadmin 中运行)连接到 Django.我已经按照文档进行操作,但它忽略了安装 mysqlclient 的需要,并且在这一点上卡住了.

                  My objective is to simply connect a legacy mysql database (running inside of XAMPP and myphpadmin) to Django. I've followed the documentation which misses out the need to install mysqlclient, and have got stuck at this point.

                  推荐答案

                  我就是这样解决的.

                  转到您的 django/db/backends/mysql 安装目录.检查错误消息中的路径.

                  Go to your django/db/backends/mysql installation dir. Check your path in the error message.

                  我正在使用 pipenv 所以我的路径是:

                  I'm using pipenv so my path is:

                  /home/username/.local/share/virtualenvs/project-env/lib/python3.7/site-packages/django/db/backends/mysql

                  /home/username/.local/share/virtualenvs/project-env/lib/python3.7/site-packages/django/db/backends/mysql

                  如果您使用传统的 env,您的路径将是:

                  If you use traditional env your path would be:

                  /Lib/site-packages/django/db/base.py

                  <env_directory_name>/Lib/site-packages/django/db/base.py

                  打开文件 base.py 并搜索:

                  Open file base.py and search for:

                  version = Database.version_info
                  

                  在 if 和注释行中放入 pass:

                  Put a pass inside if and comment line:

                  raise ImproperlyConfigured('mysqlclient 1.3.13 or newer is required;你有 %s.% 数据库.版本)

                  raise ImproperlyConfigured('mysqlclient 1.3.13 or newer is required; you have %s.' % Database.version)

                  像这样.

                  if version < (1, 3, 13):
                     pass
                     '''
                     raise ImproperlyConfigured(
                         'mysqlclient 1.3.13 or newer is required; you have %s.'
                         % Database.__version__
                     )
                     '''
                  

                  保存,关闭此文件并打开operations.py.

                  Save, close this file and open operations.py.

                  搜索:

                  query = query.decode(errors='replace')
                  

                  并将解码更改为编码

                  query = query.encode(errors='replace')
                  

                  现在,尝试运行服务器.

                  Now, try to run the server.

                  @edit

                  在得到这个答案之前,我没有找到其他方法来解决它.今天有更好的方法来处理这个问题.这个答案有更好的方法.

                  Until this answer, I found no other way to solve it. Today there are better ways to deal with this problem. This answer has a better approach.

                  这篇关于Django - 安装 mysqlclient 错误:需要 mysqlclient 1.3.13 或更新版本;你有 0.9.3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何将数据插入具有自动递增主键的 MySQL? 下一篇:如何在 MySQL 中实现关键字搜索?

                  相关文章

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

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

                  3. <legend id='o1mnu'><style id='o1mnu'><dir id='o1mnu'><q id='o1mnu'></q></dir></style></legend>

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