当前位置:论坛首页 > Linux面板 > 求助

【待反馈】安装了mysqlclient但是还是运行时还是报错说未安装

发表在 Linux面板2023-7-17 19:18 [复制链接] 1 2614

为了能快速了解并处理您的问题,请提供以下基础信息:
面板、插件版本:

免费版8.0.0 mysql8.0
系统版本:

centos7.6
问题描述:

在添加后运行django项目时显示未安装mysqlclient,但是我已经在添加项目后安装了django和mysqlclient
相关截图(日志、错误):

显示已经安装mysqlclient
[root@iZuf6dpwfz92a4pavfx3atZ NFCAD]# pip3 install mysqlclient
Looking in indexes: https://mirrors.aliyun.com/pypi/simple
Requirement already satisfied: mysqlclient in /www/server/pyporject_evn/9705526ef8a122c21464121e8fe09689_venv/lib/python3.8/site-packages (2.2.0)
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

但是执行makemigrations时报错

日志

django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module.Did you install mysqlclient?unable to load app 0 (mountpoint='') (callable not found or import error)*** no app loaded. going in full dynamic mode ****** uWSGI is running in multiple interpreter mode ***spawned uWSGI master process (pid: 10740)spawned uWSGI worker 1 (pid: 10747, cores: 2)spawned uWSGI worker 2 (pid: 10748, cores: 2)spawned uWSGI worker 3 (pid: 10750, cores: 2)spawned uWSGI worker 4 (pid: 10751, cores: 2)spawned uWSGI http 1 (pid: 10752)
使用道具 举报 只看该作者 回复
发表于 2023-7-17 23:46:02 | 显示全部楼层
您好,您当前已安装了mysqlclient,错误消息中提到了应用加载错误。您可确保 Django 项目的设置文件中正确配置了应用的路径和名称。检查您的 INSTALLED_APPS 设置项,确保应用名称正确且路径可访问。
使用道具 举报 回复 支持 反对
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

普通问题处理

论坛响应时间:72小时

问题处理方式:排队(仅解答)

工作时间:白班:9:00 - 18:00

紧急运维服务

响应时间:3分钟

问题处理方式:宝塔专家1对1服务

工作时间:工作日:9:00 - 18:30

宝塔专业团队为您解决服务器疑难问题

点击联系技术免费分析

工作时间:09:00至18:30

快速回复 返回顶部 返回列表