amorenoz / ovs-dbg

Scripts to help debug OVS and OVN
Apache License 2.0
22 stars 8 forks source link

ModuleNotFoundError: No module named 'ovs.flow' when running "ofparse openflow html > /myflows.html" #110

Closed haojue closed 1 year ago

haojue commented 1 year ago

This may be just a doc enhancement or issue fix:

I followed the instruction in installation section of https://github.com/amorenoz/ovs-dbg to install, specifically this command pip install ovs-dbg, after the installation:

ofparse openflow html > /myflows.html failed with error:

/usr/local/bin/ovs-ofparse openflow html > /myflows.html
Traceback (most recent call last):
  File "/usr/local/bin/ovs-ofparse", line 3, in <module>
    from ovs_dbg.ofparse import main
  File "/usr/local/lib/python3.6/site-packages/ovs_dbg/ofparse/__init__.py", line 1, in <module>
    import ovs_dbg.ofparse.ofp  # noqa: F401
  File "/usr/local/lib/python3.6/site-packages/ovs_dbg/ofparse/ofp.py", line 4, in <module>
    from ovs.flow.ofp import OFPFlow
ModuleNotFoundError: No module named 'ovs.flow'

python -V Python 3.6.8

OS -rhel86

cat /etc/os-release
NAME="Red Hat Enterprise Linux"
VERSION="8.6 (Ootpa)"
ID="rhel"
ID_LIKE="fedora"
VERSION_ID="8.6"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Red Hat Enterprise Linux 8.6 (Ootpa)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:8::baseos"
HOME_URL="https://www.redhat.com/"
DOCUMENTATION_URL="https://access.redhat.com/documentation/red_hat_enterprise_linux/8/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"

REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 8"
REDHAT_BUGZILLA_PRODUCT_VERSION=8.6
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="8.6"
amorenoz commented 1 year ago

Hi @haojue thanks for reporting.

I cannot reproduce on centos:stream8. This works for me:

podman run -v ./ofproto-dump.txt:/tmp/ofproto-dump.txt:z -it centos:stream8 sh -c "dnf -y install python3-pip && pip3 install ovs-dbg && ovs-ofparse -i /tmp/ofproto-dump.txt openflow html"

Can you please check you have the latest version installed? e.g: pip3 list | grep ovs should give you a hint or pip3 install --force-reinstall --no-cache-dir --upgrade ovs-dbg can reinstall and upgrade the package if present.

haojue commented 1 year ago

Hi @amorenoz ,

Thank you for your reply! Sorry for late response! I checked with the command you shared, this is the output.

WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
easyovs                      0.5
ovs                          2.12.4
ovs-dbg                      0.0.15
ovsdbapp                     1.2.1

and the output from python console:

python
Python 3.6.8 (default, Jun 14 2022, 12:54:06)
[GCC 8.5.0 20210514 (Red Hat 8.5.0-10)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from ovs.flow.ofp import OFPFlow
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'ovs.flow'
amorenoz commented 1 year ago

sorry for the delay, I think I know what's going on. If you could try building locally #111? Remember to use ./prepare.sh before pip install .