在 ubuntu/plesk 上为 django 安装 mysqclient 时出现严重错误

问题描述

我创建了 Django 项目。当我在 settings.py 上添加 MysqL 数据库配置和 migrate 时,所有内容都是在 MysqL 数据库上创建的。我正在使用 plesk 。 当我创建超级用户时,它被添加到 auth_users 数据库中。但是当我想与任何用户一起输入 django admin 时,我收到 user_auth 错误并且 django 仍然在 sqlite 数据库中查找信息。 这是在 plesk 服务器/ubuntu 上。

当我创建相同的 django 项目并使用 freedbhosting 并执行相同的操作时,我没有遇到任何错误,并且我使用 MysqL 进入管理面板。 我搜索并发现 mabe 我需要在 plesk/ubuntu 服务器上安装 MysqLclient,所以我想尝试安装它,但是当我想安装 mysqclient 时出现此错误

 Using cached MysqLclient-2.0.3.tar.gz (88 kB)
Building wheels for collected packages: MysqLclient
  Building wheel for MysqLclient (setup.py) ... error
 ERROR: Command errored out with exit status 1:
  command: /usr/bin/python3 -u -c 'import sys,setuptools,tokenize; sys.argv[0] = '"'"'/tmp/pip- 
 install-r9g0_kiz/MysqLclient_1e646ce6b9aa48bbb86f7b3a5092790f/setup.py'"'"'; __file__='"'"'/tmp/pip- 
 install-r9g0_kiz/MysqLclient_1e646ce6b9aa48bbb86f7b3a5092790f/setup.py'"'"';f=getattr(tokenize,'"'"'open'"'"',open)(__file__);code=f.read().replace('"'"'\r\n'"'"','"'"'\n'"'"');f.close();exec(compile(code,__file__,'"'"'exec'"'"'))' bdist_wheel -d /tmp/pip- 
wheel-        
 zeq33vj3
   cwd: /tmp/pip-install-r9g0_kiz/MysqLclient_1e646ce6b9aa48bbb86f7b3a5092790f/
  Complete output (41 lines):
  MysqL_config --version
  ['5.7.32']
  MysqL_config --libs
  ['-L/usr/lib/x86_64-linux-gnu','-lMysqLclient','-lpthread','-lz','-lm','-lrt','-latomic','-          
lssl','-lcrypto','-ldl']
MysqL_config --cflags
['-I/usr/include/MysqL']
ext_options:
library_dirs: ['/usr/lib/x86_64-linux-gnu']
libraries: ['MysqLclient','pthread','m','rt','atomic','dl']
extra_compile_args: ['-std=c99']
extra_link_args: []
include_dirs: ['/usr/include/MysqL']
extra_objects: []
define_macros: [('version_info',"(2,3,'final',0)"),('__version__','2.0.3')]
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/MysqLdb
copying MysqLdb/__init__.py -> build/lib.linux-x86_64-3.6/MysqLdb
  copying MysqLdb/_exceptions.py -> build/lib.linux-x86_64-3.6/MysqLdb
copying MysqLdb/connections.py -> build/lib.linux-x86_64-3.6/MysqLdb

building 'MysqLdb._MysqL' extension
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/MysqLdb
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat - 
  Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Dversion_info=(2,0) - 
D__version__=2.0.3 -I/usr/include/MysqL -I/usr/include/python3.6m -c MysqLdb/_MysqL.c -o 
 build/temp.linux-x86_64-3.6/MysqLdb/_MysqL.o -std=c99
unable to execute 'x86_64-linux-gnu-gcc': No such file or directory
error: command 'x86_64-linux-gnu-gcc' Failed with exit status 1
----------------------------------------
  ERROR: Failed building wheel for MysqLclient
 Running setup.py clean for MysqLclient
Failed to build MysqLclient
Installing collected packages: MysqLclient
Running setup.py install for MysqLclient ... error
ERROR: Command errored out with exit status 1:

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)