python - 无法在ubuntu中使用pip3为django安装mysqlclient

标签 python django mysql-connector

命令: sudo -H pip3 install 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

Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-b0rfercj
/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-lck3vdnw-record
/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in 
/tmp/pip-build-b0rfercj/mysqlclient/

我已经安装了 python3-dev

python3-dev is already the newest version (3.6.7-1~18.04).

最佳答案

您安装了libssllibcrypto吗?

sudo apt-get install libssl-dev
sudo apt-get install libssl-dev

关于python - 无法在ubuntu中使用pip3为django安装mysqlclient,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59029291/

相关文章:

python - 如何指定 Django 表单中字段的顺序?

c++ - MySQL Connector C++ cgi 程序是否像 php 一样易受 MySQL 注入(inject)攻击?

python - 如何加快读取压缩 HDF5 文件的速度

python - 如何从字典中的列表中的字典键中获取所有值

python - 在数据流中包含其他文件

python - 如何在 Django 用户模型中保存时执行代码?

python - 根据Python,OpenCV中的优先级对轮廓进行排序

python - 第三方应用程序的 Django 翻译

python - 检查一个类是否是包的成员

mysql - 如何部署连接到 MySql 数据库的 Lightswitch 应用程序