Solved

LogPoint 7 Python error running script

  • 11 April 2022
  • 2 replies
  • 174 views

Userlevel 2
Badge +1

Hi

Has there been some changes in the implementation of Python in LogPoint 7.

I have a script 2 scripts that ran without errors in LogPoint 6 but now I get:

--

Traceback (most recent call last):
  File "device_export_lp6.py", line 17, in <module>
    from pylib import mongo
ModuleNotFoundError: No module named 'pylib'
 

--

 

Regards

Hans

icon

Best answer by HansHenrikMoerkholt 19 April 2022, 11:53

View original

2 replies

Userlevel 4
Badge +8

It looks like the use of pylib and dependencies was limited to the root and loginspect user.

Try becoming root (e.g. with the partner user) and run 

/opt/immune/bin/envdo python YOUR_PYTHON_SCRIPT.py

Userlevel 2
Badge +1

Hi MArkus

 

Thanks a lot for the answer.

I succeeded in solving the issue for one script by adding the following two lines to the code.

---------------------

#!/opt/immune/bin/envdo /usr/bin/python3.7

sys.path.append('/opt/logpoint/python/lib/python3.7/site-packages')

 

---------

Regards

Hanss

 

Reply