python - 无法在 ubuntu 中使用 pip3 为 django 安装 mysqlclient
问题描述
命令: 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).
解决方案
你安装libssl
和了libcrypto
吗?
sudo apt-get install libssl-dev
sudo apt-get install libssl-dev
推荐阅读
- algorithm - 2个元素数组中的最大乘积
- pagination - 使用 Pagination n LogDNA 导出日志
- authentication - Keycloak:如何连接到 Google 身份提供程序以编程方式添加角色
- android - 如何为 Android 不同平台打包原生预建库
- c - 如果我们想在 C 程序中调用多于 1 个 switch 语句,我该怎么办?
- python - 如何在 Pytorch 中实际应用 Conv2d 过滤器
- html - 如何使 div 与表中的 td 内联?
- arrays - 如何在不选择的情况下将单元格中的数据作为数组在同一列中的一行中获取?
- linux - 如何告诉 gcc 获取我的头文件并忽略系统头文件?
- ruby-on-rails - RoR - Bundler 找不到 gem 的兼容版本