无法安装mysqlclient

时间:2018-07-18 14:59:57

标签: python mysql django

我是django的新手,但我知道MySQL。但是,我想将django与mysql连接,但是在此时我必须安装mysqlclient却卡住了错误。我已经安装了mysql服务器,创建了virtualenv,但仍然无法安装mysqlclient。

这是我遇到的错误:

/usr/bin/ld: cannot find -lssl
/usr/bin/ld: cannot find -lcrypto
collect2: error: ld returned 1 exit status
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

----------------------------------------

命令“ / home / devesh / django-apps / myproject / myprojectenv / bin / python3 -u -c”导入设置工具,标记化; 文件 ='/ tmp / pip-install-vaq3j43s / mysqlclient / setup.py'; f = getattr(tokenize,'open',open)(文件); code = f.read()。replace('\ r \ n','\ n '); f.close(); exec(compile(code, file ,'exec'))“安装--record /tmp/pip-record-v5qqxse5/install-record.txt- “单一版本外部管理的--compile --install-headers /home/devesh/django-apps/myproject/myprojectenv/include/site/python3.5/mysqlclient”失败,在/ tmp / pip-install中出现错误代码1 -vaq3j43s / mysqlclient /

1 个答案:

答案 0 :(得分:4)

您需要安装软件包

sudo apt-get install libpq-dev python-dev libxml2-dev libxslt1-dev libldap2-dev libsasl2-dev libffi-dev