robshakir / pyangbind

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

No module named pyangbind #254

Closed jessie115588 closed 5 years ago

jessie115588 commented 5 years ago

Hi, there

I am new to use pyang and pyangbind, I have windows machine with pycharm IDE, pyang is not supported by windows, so I have CYGWIN emulator for YANG, in order to use pyangbind, I was following the instructions

https://github.com/robshakir/pyangbind

and when trying to point provide pointer to PYANG where PyangBind's plugin is installed

I got error"No module named pyangbind", but it did show in the pip list....

Any idea how can I make pyangbind running? `--------------- Administrator@YY-WIN16K-MNGT2 /cygdrive/c/users/administrator/pycharmprojects/perutest/yang_models/openconfig/public-master/release/models/acl $ python --version Python 2.7.16

Administrator@YY-WIN16K-MNGT2 /cygdrive/c/users/administrator/pycharmprojects/perutest/yang_models/openconfig/public-master/release/models/acl $ pip --version pip 19.2.1 from c:\users\administrator\appdata\local\programs\python\python36-32\lib\site-packages\pip (python 3.6)

Administrator@YY-WIN16K-MNGT2 /cygdrive/c/users/administrator/pycharmprojects/perutest/yang_models/openconfig/public-master/release/models/acl $ pyang --version pyang 2.0.1

Administrator@YY-WIN16K-MNGT2 /cygdrive/c/users/administrator/pycharmprojects/perutest/yang_models/openconfig/public-master/release/models/acl $ pip list pyangbind Package Version


astroid 2.2.5 bitarray 1.0.1 certifi 2019.6.16 chardet 3.0.4 colorama 0.4.1 configparser 3.7.4 enum34 1.1.6 idna 2.8 isort 4.3.21 lazy-object-proxy 1.4.1 lxml 4.3.4 mccabe 0.6.1 pip 19.2.1 pyang 2.0.1 pyangbind 0.8.1 pylint 2.3.1 pymacro 1.0 pynmscsext 1.0 regex 2019.6.8 requests 2.22.0 setuptools 39.0.1 simplejson 3.16.0 six 1.12.0 typed-ast 1.4.0 typedecorator 0.0.5 typing 3.7.4 urllib3 1.25.3 wrapt 1.11.2

Administrator@YY-WIN16K-MNGT2 /cygdrive/c/users/administrator/pycharmprojects/perutest/yang_models/openconfig/public-master/release/models/acl $ /usr/bin/env python -c 'import pyangbind; import os; print "%s/plugin" % os.path.dirname(pyangbind.file)' Traceback (most recent call last): File "", line 1, in ImportError: No module named pyangbind -------------------------- `

jessie115588 commented 5 years ago

I don't know what went wrong inside cygwin, but I did following steps to make it working without any errors.

=========SOLUTION======================================================================== python -m pip install pyangbind==0.6.0

export PYBINDPLUGIN=/usr/bin/env python2.7 -c 'import pyangbind; import os; print("%s/plugin" % os.path.dirname(pyangbind.__file__))'