community/libreoffice: pyuno path not set [HASFIX]
issue
pyUNO is neither installed to site-packages no to dist-packages.
error
>>> import uno
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'uno'
fix
Do it the Debian way:
- copy the needed files to site-packages
- point to the LO's program path
# define path
PATH_LO=/usr/lib/libreoffice/program
PATH_SP=/usr/lib/python3.10/site-packages
# copy unohelper.py
cp "$PATH_LO"/unohelper.py "$PATH_SP"/
# prefix path to uno.py
cat << EOF > "$PATH_SP"/uno.py
import sys, os
sys.path.append('/usr/lib/libreoffice/program')
os.putenv('URE_BOOTSTRAP', 'vnd.sun.star.pathname:/usr/lib/libreoffice/program/fundamentalrc')
EOF
# copy the original's content
cat "$PATH_LO"/uno.py >> "$PATH_SP"/uno.py