This topic is related to the post [beta testers wanted!] Jython addon w/ helper libraries (requires OH 2.5.x), or more general, the Jython addon w/ helper libraries (requires OH 2.5.x) topic. I have been asked to create a new topic for this.
Problem is how to add a module requests
to python scripts ran using the Help Library beta for Jython. This beta is coming with its own jython instance in /etc/openhab2/automation/jython/jython-standalone-2.7.1.jar
After issuing the command proposed
sudo -u openhab pip2 install --ignore-installed --install-option="--prefix=/etc/openhab2/automation/lib/python" requests
the module requests
is still not available for Jython scripts. import requests
generates an error the module is not available.
Searching for “requests” on top level of my openHABian installation reveals this:
[09:19:32] openhabian@openhab:/$ sudo ls -axld $(sudo find . -name 'requests')
drwxr-xr-x 2 openhabian openhab 4096 May 2 14:58 ./etc/openhab2/automation/lib/jython/requests
drwxr-xr-x 2 openhabian openhab 4096 May 2 14:58 ./srv/openhab2-conf/automation/lib/jython/requests
drwxr-xr-x 2 openhab openhab 4096 Jun 21 12:35 ./srv/openhab2-userdata/.local/lib/python2.7/site-packages/requests
drwxr-xr-x 2 root root 4096 May 2 14:51 ./usr/lib/python2.7/dist-packages/requests
drwxr-xr-x 3 root root 4096 Jul 10 2019 ./usr/lib/python3/dist-packages/requests
drwxr-sr-x 2 root staff 4096 Dec 30 18:34 ./usr/local/lib/python2.7/dist-packages/requests
drwxr-xr-x 2 openhab openhab 4096 Jun 21 12:35 ./var/lib/openhab2/.local/lib/python2.7/site-packages/requests
Question: how to install requests for the dedicated jython instance.