当更改配置以使用 MySQL 作为数据库时,我在尝试启动 Django 服务器时遇到错误 (python manage.py runserver) 它问我是否安装了 mysqlclient,在对 SO 进行了一番挖掘后,我终于能够做到这一点。它结束的错误是:django.core.exceptions.ImproperlyConfigured:加载 MySQLdb 模块时出错。在 Traceback 的高处,它指出此异常导致了另一个异常:Traceback (most recent call last): File "/Users/username/PycharmProjects/projectname/venv/lib/python3.6/site-packages/django/db/backends/mysql/base.py", line 15, in <module> import MySQLdb as Database File "/Users/username/PycharmProjects/projectname/venv/lib/python3.6/site-packages/MySQLdb/__init__.py", line 18, in <module> import _mysqlImportError: dlopen(/Users/username/PycharmProjects/projectname/venv/lib/python3.6/site-packages/_mysql.cpython-36m-darwin.so, 2): Library not loaded: @rpath/libssl.1.0.0.dylib Referenced from: /Users/username/PycharmProjects/projectname/venv/lib/python3.6/site-packages/_mysql.cpython-36m-darwin.so Reason: image not found有很多与此类似的问题,我尝试了很多,但似乎无法让它发挥作用。我尝试将 MySQLdb 直接添加为包,但随后出现错误:找不到满足 MySQLdb 要求的版本(来自版本:)未找到 MySQLdb 的匹配发行版正如所说; mysqlclient 已安装。有任何想法吗?
添加回答
举报
0/150
提交
取消