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#

相关参考:

相关推荐
Nightwish361 小时前
RHCA练习1
linux·运维
泥水沟的胖头鱼2 小时前
dbeaver创建create临时表之后查询不到问题排查
数据库·sql
PhoenixFlyAway3 小时前
datahub汉化之路
数据库
閤廴聿4 小时前
vmware-ubuntu22.04配置虚拟机win10,重新上网成功
linux·windows·ubuntu
阿杰学编程5 小时前
1、什么是GO
服务器·开发语言·golang
Danileaf_Guo6 小时前
当你买了一台Linux云主机,应该如何测试主机性能?
linux·运维·服务器
我的运维人生6 小时前
MySQL深度解析:高性能优化与实战案例
数据库·mysql·性能优化·运维开发·技术共享
kyle-fang6 小时前
SQL概述
数据库·sql
OldGj_7 小时前
「sql之窗口函数」
java·数据库·sql
鹿人甲丁7 小时前
Microsoft Sql Server 2019 函数理解
数据库·sqlserver