“Vagrant Up”期间没有名为“netifaces”的模块

问题描述

执行 vagrant up 时,出现以下错误

The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command Failed!

mv -f '/tmp/vagrant-network-entry-1624290630' '/etc/netplan/50-vagrant.yaml'
chown root:root '/etc/netplan/50-vagrant.yaml'
chmod 0644 '/etc/netplan/50-vagrant.yaml'
netplan apply

Stdout from the command:



Stderr from the command:

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 25,in <module>
    import netifaces
ModuleNotFoundError: No module named 'netifaces'

我已经“sudo -H pip3 install netifaces”了,这似乎并没有解决问题。谢谢!

解决方法

您可以先尝试sudo apt-get update -y,然后再尝试sudo apt-get install -y python3-netifaces