pyroute2 icon indicating copy to clipboard operation
pyroute2 copied to clipboard

fix `pyroute2.arp` export

Open svinota opened this issue 2 years ago • 9 comments

With what do I replace pyroute2.arp ? I have a module that contains, amongst other stuff,

import pyroute2
import pyroute2.arp
...
        self.ip = pyroute2.IPRoute()
...
        for ifl in self.ip.get_links():
            ifl_index = ifl["index"]
            ifl_type = pyroute2.arp.ARPHRD_VALUES.get(ifl["ifi_type"], "UNKNOWN")

and I get an error on importing:

mymodule.py:6: in <module>
    import pyroute2.arp
E   ModuleNotFoundError: No module named 'pyroute2.arp'

Also, it seems that python 3.5 support has been dropped?

Originally posted by @oseiberts11 in https://github.com/svinota/pyroute2/discussions/786#discussioncomment-2558030

svinota avatar Apr 13 '22 23:04 svinota

@oseiberts11 The fix for that is pushed into the master branch.

If the git version is not an option, you can use import pr2modules.arp until the next release will be tagged and rolled out.

Regarding Python 3.5: yes, I don't test the project on this version anymore.

svinota avatar Apr 13 '22 23:04 svinota

Closing as resolved. Will you find any further issue — don't hesitate to reopen or open a new ticket. Thanks!

svinota avatar Apr 17 '22 18:04 svinota

If the git version is not an option, you can use import pr2modules.arp until the next release will be tagged and rolled out.

it's a no-go for me. any help?

    from pyroute2.arp import ARPHRD_ETHER
ModuleNotFoundError: No module named 'pyroute2.arp'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/sbin/bonding-setup", line 25, in <module>
    from pr2modules.arp import ARPHRD_ETHER
ModuleNotFoundError: No module named 'pr2modules.arp'
S | Name                      | Type    | Version           | Arch   | Repository
--+---------------------------+---------+-------------------+--------+------------------
i | python3-pyroute2          | package | 0.6.13-lp154.56.4 | noarch | (System Packages)
v | python3-pyroute2          | package | 0.5.10-3.3.1      | noarch | oss
i | python3-pyroute2.core     | package | 0.6.13-lp154.7.4  | noarch | (System Packages)
i | python3-pyroute2.ethtool  | package | 0.6.13-lp154.7.4  | noarch | (System Packages)
i | python3-pyroute2.ipdb     | package | 0.6.13-lp154.8.4  | noarch | (System Packages)
i | python3-pyroute2.ipset    | package | 0.6.13-lp154.7.4  | noarch | (System Packages)
i | python3-pyroute2.ndb      | package | 0.6.13-lp154.7.4  | noarch | (System Packages)
i | python3-pyroute2.nftables | package | 0.6.13-lp154.7.4  | noarch | (System Packages)
i | python3-pyroute2.nslink   | package | 0.6.13-lp154.7.4  | noarch | (System Packages)

257 avatar Jul 18 '22 20:07 257

@257 could be an upgrade to >=0.7.1 an option?

svinota avatar Jul 18 '22 20:07 svinota

Closing as resolved. Will you find any further issue — don't hesitate to reopen or open a new ticket. Thanks!

please re-open, thanks.

257 avatar Jul 18 '22 20:07 257

Also, there are some addition issues fixed in the master, and 0.7.2 will be rolled out this week.

svinota avatar Jul 18 '22 20:07 svinota

@257 could be an upgrade to >=0.7.1 an option?

not really, unless i get distro's (opensuse) package maintainer to bump. will try.

257 avatar Jul 18 '22 20:07 257

@257 could be an upgrade to >=0.7.1 an option?

hmm, my installed version is 0.6.13, fe298da347bfb215869510efc727494be12cc09a, which comes after 7d937172acea9bb1b2417bf096de4b4c1c264d48 (the fix for this). what's going on!?

257 avatar Jul 18 '22 20:07 257

That's a bug in the packaging — at least on my side. The pyroute2 pypi is missing the dependency on pyroute2.protocols.

Either OpenSuse has pyroute2.protocols too — and it's install will help — or it's missing it completely, and then only the version bump may help, as >=0.7.1 doesn't use this packaging scheme anymore.

svinota avatar Jul 18 '22 20:07 svinota