robshakir / pyangbind

A plugin for pyang that creates Python bindings for a YANG model.
Other
204 stars 121 forks source link

ModuleNotFoundError: No module named 'bitarray' - Python 3.9 on MacOS #277

Closed tardoe closed 1 year ago

tardoe commented 3 years ago

There seems to be an issue with importing the bitarray module - the module imports just fine with a plain python runtime prompt but the plugin call doesn't seem to acknowledge it's installed.

(venv) ➜  yang_test pyang --plugindir $VIRTUAL_ENV/lib/python3.9/site-packages/pyangbind/plugin -f pyang -o bindings.py -p ~/Development/openconfig/release/models ~/Development/openconfig/release/models/interfaces/openconfig-interfaces.yang
Traceback (most recent call last):
  File "/usr/local/bin/pyang", line 533, in <module>
    run()
  File "/usr/local/bin/pyang", line 33, in run
    plugin.init(plugindirs)
  File "/usr/local/lib/python3.9/site-packages/pyang/plugin.py", line 59, in init
    pluginmod = __import__(modname)
  File "/Users/user/Development/yang_test/venv/lib/python3.9/site-packages/pyangbind/plugin/pybind.py", line 33, in <module>
    from bitarray import bitarray
ModuleNotFoundError: No module named 'bitarray'
(venv) ➜  yang_test
(venv) ➜  yang_test
(venv) ➜  yang_test python --version
Python 3.9.1
(venv) ➜  yang_test pip freeze
bitarray==2.2.0
enum34==1.1.10
lxml==4.6.3
pyang==2.5.0
pyangbind==0.8.1
regex==2021.7.1
six==1.16.0
JoseIgnacioTamayo commented 1 year ago

This should by fixed in the next release, as bitarray library is no longer used. See https://github.com/robshakir/pyangbind/pull/297.