解决django项目报错很离谱的报错之RuntimeError: populate() isn't reentrant
![](https://img2022.cnblogs.com/blog/2097017/202209/2097017-20220916142349626-1796414411.png)
1.看到这个报错是不是很懵逼
2.去修改这个文件
/usr/local/lib/python3.6/site-packages/django/apps/registry.py
3.到最后面发现是包安装的不够 就会报错
django==2.2.26
celery==5.0.5
mongoengine==0.22.1
djangorestframework==3.12.2
django-cors-headers==3.7.0
django-simple-captcha==0.5.13
django_celery_beat==2.2.0
drf-yasg==1.20.0
PyMySQL==1.0.2
mysqlclient==1.4.6
jsonfield==3.1.0
djangorestframework-jwt==1.11.0
django-filter==2.4.0
xlrd==2.0.1
xlwt==1.3.0
user-agents==2.2.0
psutil==5.8.0
pycryptodome==3.14.1
pyyaml==6.0
BZ:linux安装mysqlclient报错 OSError: mysql_config not found
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
OSError: mysql_config not found 安装:mysqlclient的时候报错 Preparing metadata (setup.py) ... error ERROR: Command errored out with exit status 1: command: /usr/bin/python3.6 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ej3mzpr2/mysqlclient_a06a405a81cb4c51972465eb6bf39a46/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ej3mzpr2/mysqlclient_a06a405a81cb4c51972465eb6bf39a46/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-22f2qu3x cwd: /tmp/pip-install-ej3mzpr2/mysqlclient_a06a405a81cb4c51972465eb6bf39a46/ Complete output (15 lines): /bin/sh: mysql_config: command not found /bin/sh: mariadb_config: command not found /bin/sh: mysql_config: command not found mysql_config --version mariadb_config --version mysql_config --libs Traceback (most recent call last): File "<string>", line 1, in <module> File "/tmp/pip-install-ej3mzpr2/mysqlclient_a06a405a81cb4c51972465eb6bf39a46/setup.py", line 15, in <module> metadata, options = get_config() File "/tmp/pip-install-ej3mzpr2/mysqlclient_a06a405a81cb4c51972465eb6bf39a46/setup_posix.py", line 70, in get_config libs = mysql_config("libs") File "/tmp/pip-install-ej3mzpr2/mysqlclient_a06a405a81cb4c51972465eb6bf39a46/setup_posix.py", line 31, in mysql_config raise OSError("{} not found".format(_mysql_config_path)) OSError: mysql_config not found ---------------------------------------- WARNING: Discarding http://mirrors.cloud.aliyuncs.com/pypi/packages/50/5f/eac919b88b9df39bbe4a855f136d58f80d191cfea34a3dcf96bf5d8ace0a/mysqlclient-2.1.1.tar.gz#sha256=828757e419fb11dd6c5ed2576ec92c3efaa93a0f7c39e263586d1ee779c3d782 (from http://mirrors.cloud.aliyuncs.com/pypi/simple/mysqlclient/) (requires-python:>=3.5). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output. ERROR: Could not find a version that satisfies the requirement mysqlclient==2.1.1 (from versions: 1.3.0, 1.3.1, 1.3.2, 1.3.3, 1.3.4, 1.3.5, 1.3.6, 1.3.7, 1.3.8, 1.3.9, 1.3.10, 1.3.11rc1, 1.3.11, 1.3.12, 1.3.13, 1.3.14, 1.4.0rc1, 1.4.0rc2, 1.4.0rc3, 1.4.0, 1.4.1, 1.4.2, 1.4.2.post1, 1.4.3, 1.4.4, 1.4.5, 1.4.6, 2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.1.0rc1, 2.1.0, 2.1.1) ERROR: No matching distribution found for mysqlclient==2.1.1 解决办法: yum install mysql-devel 再安装 pip3 install mysqlclient
yum install mysql-devel -y
# 如果报错
yum install python3-devel gcc -y
pip3 install mysqlclient==2.1.1
-----------------------------------------------------------------------------------------------------------------------------------------