繁体   English   中英

Mininet 主机上的 pip 找不到已安装的软件包

[英]pip on a Mininet host cant find installed packages

我在 VM 上有Mininet ,我使用pip安装了一个名为wsproto的包,但是当我尝试从 Mininet 主机内部使用该包时,我收到一个错误,表明该包丢失:

Traceback (most recent call last):
  File "examples/http3_server.py", line 10, in <module>
    import wsproto
ModuleNotFoundError: No module named 'wsproto'

事实证明,Mininet 主机可用的包远远少于系统上实际安装的包!

我的问题:如何安装 Python 包并使其可用于 Mininet?

我在 Ubuntu 20.04 上运行,使用 Python 3.8.10:

$ whereis python3
python3: /usr/bin/python3.8-config /usr/bin/python3 /usr/bin/python3.8 /usr/lib/python3 /usr/lib/python3.8 /usr/lib/python3.9 /etc/python3 /etc/python3.8 /usr/local/lib/python3.8 /usr/include/python3.8 /usr/share/python3 /usr/share/man/man1/python3.1.gz

在 Mininet 上:

h1 whereis python3
python3: /usr/bin/python3.8-config /usr/bin/python3 /usr/bin/python3.8 /usr/lib/python3 /usr/lib/python3.8 /usr/lib/python3.9 /etc/python3 /etc/python3.8 /usr/local/lib/python3.8 /usr/include/python3.8 /usr/share/python3 /usr/share/man/man1/python3.1.gz

您正在尝试将字符串user.type与未知变量fetus进行比较,您应该将其与字符串'fetus'进行比较,而不是与fetus

<div *ngIf="user.type=='fetus'">

我想出了解决方案,我不得不像这样使用sudo<\/code> :

sudo pip install wsproto

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM