06-26-2017 07:00 PM - edited 03-01-2019 03:53 AM
Hi All
I have set PYTHONPATH variable correctly (hopefully) and still cannot make NSO (v4.4.2) to load third party modules from system site-packages. i am getting following error in ncs-python-vm.log. Just FYI, the code execute fine outside of NSO VM when executed directly.
[root@localhost logs]# cat ncs-python-vm.log
2017-06-26 20:43:47 - Started PyVM: <<"ansible">> , Port=#Port<0.8378> , OSpid="19236"
2017-06-26 20:43:47 - ansible :: Starting /root/nso-4.4.2/src/ncs/pyapi/ncs_pyvm/startup.py -l info -f ./logs/ncs-python-vm -i ansible
2017-06-26 20:43:48 - ansible :: Traceback (most recent call last):
File "/root/nso-4.4.2/src/ncs/pyapi/ncs_pyvm/startup.py", line 228, in start_components
pname=pname, cname=cname, main_q=self.msg_sink)
File "/root/nso-4.4.2/src/ncs/pyapi/ncs_pyvm/ncsthreads.py", line 152, in __init__
mod = __import__(modname)
File "/root/ncs-run/state/packages-in-use/1/ansible/python/ansible/action.py", line 7, in <module>
from ansible.parsing.dataloader import DataLoader
ImportError: No module named parsing.dataloader
my pythonpath variable:
[root@localhost logs]# env | grep PYTHON
PYTHONPATH=/root/nso-4.4.2/src/ncs/pyapi:/usr/lib64/python27.zip:/usr/lib64/python2.7:/usr/lib64/python2.7/plat-linux2:/usr/lib64/python2.7/lib-tk:/usr/lib64/python2.7/lib-old:/usr/lib64/python2.7/lib-dynload:/usr/lib64/python2.7/site-packages:/usr/lib/python2.7/site-packages
What am i missing?
any help is much appreciated!
Regards
07-10-2017 07:31 AM
Was the python path set when you started NSO? I suspect NSO copies whatever PYTHONPATH is set at startup.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide