netplan apply报错No module named ‘netifaces‘

Ubuntu 20.04.5 LTS \n \l,ctrl+alt+f2切换字符登录f1切换图形

处理办法:

root登录执行

root@node37:/disk1/Qwen2.5-72B-Instruct-GPTQ-Int4# cat /etc/netplan/01-network-manager-all.yaml

Let NetworkManager manage all devices on this system

network:

version: 2

renderer: networkd

ethernets:

ibs5#:

addresses: [10.10.10.37/24]

eno1:

addresses: [192.168.7.37/24]

gateway4: 192.168.7.1

nameservers:

addresses: [223.5.5.5,114.114.114.114,8.8.8.8]

root@node37:/usr/bin# pip install netifaces

安装完成

root@node37:/usr/bin# rm /usr/bin/python3

root@node37:/usr/bin# ln -sf /usr/bin/python3.10 /usr/bin/python3

root@node37:/usr/bin# netplan apply

Traceback (most recent call last):

File "/usr/sbin/netplan", line 20, in <module>

from netplan import Netplan

File "/usr/share/netplan/netplan/init.py", line 18, in <module>

from netplan.cli.core import Netplan

File "/usr/share/netplan/netplan/cli/core.py", line 24, in <module>

import netplan.cli.utils as utils

File "/usr/share/netplan/netplan/cli/utils.py", line 23, in <module>

import netifaces

ModuleNotFoundError: No module named 'netifaces'

root@node37:/usr/bin# which python
/root/anaconda3/bin/python

root@anaconda3:/bin# ln -sf /root/anaconda3/bin/python /usr/bin/python3

root@node37:/usr/bin# ping www.baidu.com

PING www.a.shifen.com (220.181.111.1) 56(84) bytes of data.

64 bytes from 220.181.111.1 (220.181.111.1): icmp_seq=1 ttl=54 time=2.19 ms

64 bytes from 220.181.111.1 (220.181.111.1): icmp_seq=2 ttl=54 time=2.09 ms

^C

--- www.a.shifen.com ping statistics ---

2 packets transmitted, 2 received, 0% packet loss, time 1001ms

rtt min/avg/max/mdev = 2.094/2.141/2.189/0.047 ms

root@node37:/usr/bin#

相关参考:

相关推荐
AZ996ZA6 小时前
自学linux的第二十一天【DHCP 服务从入门到实战】
linux·运维·服务器·php
xu_yule6 小时前
Redis存储(15)Redis的应用_分布式锁_Lua脚本/Redlock算法
数据库·redis·分布式
_OP_CHEN6 小时前
【Linux系统编程】(二十八)深入 ELF 文件原理:从目标文件到程序加载的完整揭秘
linux·操作系统·编译·c/c++·目标文件·elf文件
Web极客码6 小时前
WordPress博客关键词
服务器·wordpress·网站加速
一灰灰blog6 小时前
Spring AI中的多轮对话艺术:让大模型主动提问获取明确需求
数据库·人工智能·spring
Fleshy数模6 小时前
MySQL 表创建全攻略:Navicat 图形化与 Xshell 命令行双模式实践
linux·mysql
Nandeska7 小时前
15、基于MySQL的组复制
数据库·mysql
神梦流7 小时前
GE 引擎的非标准数据流处理:稀疏张量与自定义算子在图优化中的语义保持
linux·运维·服务器
AllData公司负责人7 小时前
AllData数据中台-数据同步平台【Seatunnel-Web】整库同步MySQL同步Doris能力演示
大数据·数据库·mysql·开源
加油,小猿猿7 小时前
Java开发日志-双数据库事务问题
java·开发语言·数据库