[SOLVED] Running a python script using the Exec binding

Hi another query,

I’m trying to run a python script from the exec binding, it does seem to be running (it has stopped erroring in the logs) but i suspect the python is failing due to be unable to find a module

When I run the python with this

 sudo -u openhab python3.5 Nearest360.py

Traceback (most recent call last):
  File "Nearest360.py", line 4, in <module>
    import requests
ImportError: No module named 'requests'

This runs fine using the openhabian user from the command line.

Any ideas?

You need some python help. Not openHAB
install the request library

I have installed the library using pip on the openhabian user, this is specific to using the openhab user, I am investigating python forums also but suspected someone over here may have come across a similar error and solved it.

Thanks, that looks like it may have done the trick. The wonders of knowing what you are looking for

Please tick the solution post, thanks

I have the same error but I’m unable to fix it using the link provided above. What exaclty did you do to fix the issue?

Please see my answer to your question in the thread about the bmw connected python script.
You installed the request module for Python 2.7 instead of Python 3.
The bmw python script uses Python 3 and you need to install the request module with pip3.

Installing evohome systemwide worked for me:
sudo -H pip install evohomeclient