【问题标题】:pip on a Mininet host cant find installed packagesMininet 主机上的 pip 找不到已安装的软件包
【发布时间】:2019-01-24 22:19:32
【问题描述】:

我在 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

【问题讨论】:

    标签: python pip mininet


    【解决方案1】:

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

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

    【讨论】:

      【解决方案2】:

      我想出了解决方案,我不得不像这样使用sudo

      sudo pip install wsproto
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2021-09-13
        • 2019-12-16
        • 1970-01-01
        • 2019-11-08
        • 2017-01-29
        • 1970-01-01
        • 1970-01-01
        • 2017-05-26
        相关资源
        最近更新 更多