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#

相关参考:

相关推荐
AAA修煤气灶刘哥21 小时前
后端人速藏!数据库PD建模避坑指南
数据库·后端·mysql
RestCloud1 天前
揭秘 CDC 技术:让数据库同步快人一步
数据库·api
得物技术1 天前
MySQL单表为何别超2000万行?揭秘B+树与16KB页的生死博弈|得物技术
数据库·后端·mysql
轻松Ai享生活1 天前
5 节课深入学习Linux Cgroups
linux
christine-rr1 天前
linux常用命令(4)——压缩命令
linux·服务器·redis
可涵不会debug1 天前
【IoTDB】时序数据库选型指南:工业大数据场景下的技术突围
数据库·时序数据库
ByteBlossom1 天前
MySQL 面试场景题之如何处理 BLOB 和CLOB 数据类型?
数据库·mysql·面试
麦兜*1 天前
MongoDB Atlas 云数据库实战:从零搭建全球多节点集群
java·数据库·spring boot·mongodb·spring·spring cloud
三坛海会大神5551 天前
LVS与Keepalived详解(二)LVS负载均衡实现实操
linux·负载均衡·lvs
東雪蓮☆1 天前
深入理解 LVS-DR 模式与 Keepalived 高可用集群
linux·运维·服务器·lvs