前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >无法安装python3的连续报错-mysql include软链接问题

无法安装python3的连续报错-mysql include软链接问题

作者头像
HHTjim 部落格
发布2022-09-26 10:47:02
7790
发布2022-09-26 10:47:02
举报
文章被收录于专栏:HHTjim'S 部落格

无法安装python3的连续报错-mysql include软链接问题

作者:matrix 被围观: 7,092 次 发布时间:2019-03-12 分类:Python | 无评论 »

这是一个创建于 1269 天前的主题,其中的信息可能已经有所发展或是发生改变。

虚拟机ubuntu中自带了Python2,但是想要使用python3需要单独安装。使用add-apt-repository来添加ppa源安装提示command not found,之后进行安装操作sudo apt-get install software-properties-common,错误继续:

代码语言:javascript
复制
$ sudo apt-get install software-properties-common
Reading package lists... Done
Building dependency tree... 50%
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 libmysql++-dev : Depends: libmysqlclient-dev but it is not going to be installed
 software-properties-common : Depends: python3:any (>= 3.3.2-2~)
                              Depends: python3 but it is not going to be installed
                              Depends: python3-gi but it is not going to be installed
                              Depends: gir1.2-glib-2.0 but it is not going to be installed
                              Depends: python-apt-common (>= 0.9) but it is not going to be installed
                              Depends: python3-dbus but it is not going to be installed
                              Depends: python3-software-properties (= 0.96.20.8) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

继续apt-get update & upgrade & 更换国内源,后面使用apt-get install python3也是相同错误,无济于事。

错误跟踪到libmysql++-dev依赖问题,遂重新安装sudo apt-get install libmysqlclient-dev:

代码语言:javascript
复制
$ sudo apt-get install libmysqlclient-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  libmysqlclient-dev
0 upgraded, 1 newly installed, 0 to remove and 163 not upgraded.
4 not fully installed or removed.
Need to get 0 B/1,167 kB of archives.
After this operation, 7,040 kB of additional disk space will be used.
debconf: delaying package configuration, since apt-utils is not installed
(Reading database ... 51891 files and directories currently installed.)
Preparing to unpack .../libmysqlclient-dev_5.7.25-0ubuntu0.16.04.2_amd64.deb ...
Unpacking libmysqlclient-dev (5.7.25-0ubuntu0.16.04.2) ...
dpkg: error processing archive /var/cache/apt/archives/libmysqlclient-dev_5.7.25-0ubuntu0.16.04.2_amd64.deb (--unpack):
 unable to install new version of '/usr/include/mysql/mysql/plugin_ftparser.h': No such file or directory
Errors were encountered while processing:
 /var/cache/apt/archives/libmysqlclient-dev_5.7.25-0ubuntu0.16.04.2_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

尝试手动安装deb:sudo dpkg -i /var/cache/apt/archives/libmysqlclient-dev_5.7.25-0ubuntu0.16.04.2_amd64.deb失败:

代码语言:javascript
复制
unable to install new version of '/usr/include/mysql/mysql/plugin_ftparser.h': No such file or directory

根源问题

/usr/include/mysql/mysql/plugin_ftparser.h不存在

开始手动查找

代码语言:javascript
复制
$ sudo find / | grep plugin_ftparser.h

该文件只存在与/usr/local/mysql/include/目录中,ls /usr/include/mysql -al查看列表就会发现mysql的软链接出现问题导致的。

解决

重新生成mysql include软连接

代码语言:javascript
复制
$ ln -s /usr/local/mysql/include /usr/include/mysql/mysql #重新生成软连接

此虚拟机中的mysql是之前安装LNMP搭建PHP环境而创建的,很有可能和这个有关系。

参考:

https://askubuntu.com/questions/629448/file-mysql-h-cant-be-found

https://askubuntu.com/questions/773079/fixing-broken-packages-in-ubuntu-repost

PEACE~

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
如有侵权请联系 cloudcommunity@tencent.com 删除

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

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

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

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 无法安装python3的连续报错-mysql include软链接问题
    • 根源问题
      • 解决
      相关产品与服务
      云数据库 SQL Server
      腾讯云数据库 SQL Server (TencentDB for SQL Server)是业界最常用的商用数据库之一,对基于 Windows 架构的应用程序具有完美的支持。TencentDB for SQL Server 拥有微软正版授权,可持续为用户提供最新的功能,避免未授权使用软件的风险。具有即开即用、稳定可靠、安全运行、弹性扩缩等特点。
      领券
      问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档