前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >ubuntu 18.04 pip3 install mysqlclient

ubuntu 18.04 pip3 install mysqlclient

作者头像
obaby
发布2023-02-24 15:32:55
6500
发布2023-02-24 15:32:55
举报
文章被收录于专栏:obaby@mars

不知道是阿里云的问题还是ubuntu本身的问题,今天安装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

网上搜了一下没有发现类似的错误信息,于是转换思路直接搜索: /usr/bin/ld: cannot find -lssl 在这篇文章看到了解决方案:

https://blog.51cto.com/eminzhang/1285705

按照错误信息,直接尝试安装libssl:

apt install libssl-dev

Reading package lists… Done

Building dependency tree

Reading state information… Done

Suggested packages:

libssl-doc

The following NEW packages will be installed:

libssl-dev

0 upgraded, 1 newly installed, 0 to remove and 6 not upgraded.

Need to get 1,566 kB of archives.

After this operation, 7,846 kB of additional disk space will be used.

Get:1 http://mirrors.cloud.aliyuncs.com/ubuntu bionic-updates/main amd64 libssl-dev amd64 1.1.1-1ubuntu2.1~18.04.5 1,566 kB

Fetched 1,566 kB in 0s (30.7 MB/s)

Selecting previously unselected package libssl-dev:amd64.

(Reading database … 113385 files and directories currently installed.)

Preparing to unpack …/libssl-dev_1.1.1-1ubuntu2.1~18.04.5_amd64.deb …

Unpacking libssl-dev:amd64 (1.1.1-1ubuntu2.1~18.04.5) …

Setting up libssl-dev:amd64 (1.1.1-1ubuntu2.1~18.04.5) …

安装成功后,如果继续尝试安装libcrypto-dev,就会直接报错了,因为没有这个库:

Reading package lists… Done

Building dependency tree

Reading state information… Done

E: Unable to locate package libcrypto-dev

虽然报错,但是此时重新安装mysqlclient就成功了:

root@iZbp14eg6x181fumvost8tZ:/var/www/html# pip install mysqlclient

Looking in indexes: http://mirrors.cloud.aliyuncs.com/pypi/simple/

Collecting mysqlclient

Downloading http://mirrors.cloud.aliyuncs.com/pypi/packages/d0/97/7326248ac8d5049968bf4ec708a5d3d4806e412a42e74160d7f266a3e03a/mysqlclient-1.4.6.tar.gz (85kB)

100% |████████████████████████████████| 92kB 36.2MB/s

Building wheels for collected packages: mysqlclient

Running setup.py bdist_wheel for mysqlclient … done

Stored in directory: /root/.cache/pip/wheels/76/e8/97/ee5bddf8f9ef442b375f511cd0507060b8498c02f5086168f2

Successfully built mysqlclient

Installing collected packages: mysqlclient

Successfully installed mysqlclient-1.4.6

☆文章版权声明☆

* 网站名称:obaby@mars

* 网址:https://h4ck.org.cn/

* 本文标题: 《ubuntu 18.04 pip3 install mysqlclient》

* 本文链接:https://cloud.tencent.com/developer/article/2224559

* 转载文章请标明文章来源,原文标题以及原文链接。请遵从 《署名-非商业性使用-相同方式共享 2.5 中国大陆 (CC BY-NC-SA 2.5 CN) 》许可协议。


分享文章:

相关文章:

  1. OSX pip3 install mysqlclient
  2. ubuntu uwsgi No module named ‘django’
  3. certbot-auto 阿里云配置安装
  4. Install PyQt4 on Mac OSX 10.8
  5. Ubuntu 9.04
  6. Ubuntu Fcitx输入法以及Flash乱码
  7. Ubuntu 10.04安装IDA PRO
  8. ubuntu 16.04 uwsgi自启动
  9. Ubuntu 64bit 安装QQ
  10. 在 Ubuntu 上换用 OSS4 声音系统
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2020年1月13日,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 相关文章:
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档