在Ubuntu 18.04上安装mysqlclient

时间:2019-11-26 08:05:31

标签: python mysql django django-2.2

我已在Ubuntu上安装mysqlclient的步骤:

  1. python3 -m venv env
  2. source env/bin/activate
  3. sudo apt-get install python3.7-dev #or python3.8
  4. sudo apt-get install libmysqlclient-dev
  5. pip install django mysqlclient

但是,出现以下错误:

   error: command 'x86_64-linux-gnu-gcc' failed with exit status 1      
   ----------------------------------------
   Command "/home/dastan/projects/crud_add_book/env/bin/python3 -u -c 
"import setuptools,
> tokenize;__file__='/tmp/pip-build-a6zmf3am/mysqlclient/setup.py';f=getattr(tokenize,
 'open', open)(__file__);code=f.read().replace('\r\n',
 '\n');f.close();exec(compile(code, __file__, 'exec'))" install
 --record /tmp/pip-eaynvhxp-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/dastan/projects/crud_add_book/env/include/site/python3.6/mysqlclient"
 failed with error code 1 in /tmp/pip-build-a6zmf3am/mysqlclient/

0 个答案:

没有答案