Skip to content
This repository was archived by the owner on Aug 20, 2023. It is now read-only.

Scripting Framework error in Debian #28

Closed
NandanDesai opened this issue Apr 17, 2018 · 2 comments
Closed

Scripting Framework error in Debian #28

NandanDesai opened this issue Apr 17, 2018 · 2 comments

Comments

@NandanDesai
Copy link

NandanDesai commented Apr 17, 2018

I have installed python3-pygments and libreoffice-script-provider-python. But I am getting the following error:

A Scripting Framework error occurred while running the Python script vnd.sun.star.script:codehighlighter.oxt|python|highlight.py$highlight_c_default?language=Python&location=user:uno_packages.

Message: <class 'ImportError'>: No module named 'pygments' (or 'pygments.styles' is unknown)
  /opt/libreoffice5.2/program/uno.py:265 in function _uno_import() [return _g_delegatee( name, *optargs, **kwargs )]
  /opt/libreoffice5.2/program/uno.py:339 in function _uno_import() [raise uno_import_exc]
  /home/nandan/.config/libreoffice/4/user/uno_packages/cache/uno_packages/lu148736yj1g.tmp_/codehighlighter.oxt/python/highlight.py:19 in function <module>() [from pygments import styles]
  /opt/libreoffice5.2/program/pythonscript.py:452 in function getModuleByUrl() [exec(code, entry.module.__dict__)]
  /opt/libreoffice5.2/program/pythonscript.py:993 in function getScript() [mod = self.provCtx.getModuleByUrl( fileUri )]

pip show pygments outputs the following:

Name: Pygments
Version: 2.2.0
Summary: Pygments is a syntax highlighting package written in Python.
Home-page: http://pygments.org/
Author: Georg Brandl
Author-email: [email protected]
License: BSD License
Location: /home/nandan/anaconda3/lib/python3.6/site-packages
Requires: 
Required-by: Sphinx

which clearly shows that pygments is installed. And it is getting imported in interactive python terminal. I tried restarting libreoffice. But no effect.

@ruben1981
Copy link

I've resolved just copying the Pygments directory from /usr/lib/pythonx.x.x/site-packages to /opt/libreofficex.x/python-core-x.x.x/lib/site-packages.
It completely works, now.

@slgobinath
Copy link
Owner

Closing this issue as a duplicate of #29

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants