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

Fedora: Scripting Framework error #25

Open
evacchi opened this issue Mar 13, 2018 · 12 comments
Open

Fedora: Scripting Framework error #25

evacchi opened this issue Mar 13, 2018 · 12 comments

Comments

@evacchi
Copy link

evacchi commented Mar 13, 2018

When I select the menu item:

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

Message: <class 'KeyError'>: 'codehighlighter.oxt'
  File "/usr/lib64/libreoffice/program/pythonscript.py", line 993, in getScript
    self.provCtx.uriHelper.getStorageURI(scriptUri) );
  File "/usr/lib64/libreoffice/program/pythonscript.py", line 381, in getStorageUrlFromPersistentUrl
    package = self.mapPackageName2Path[ packageName ]

pygments is installed

@slgobinath
Copy link
Owner

Hi,
How did you install code highlighter? Did you use .oxt file or .zip file from GitHub releases?

@evacchi
Copy link
Author

evacchi commented Mar 14, 2018

Hi,
I downloaded from libreoffice extension website, I've also tried to download oxt from github, to the same effect.
It looks like Python support should be installed, I could run the Hello World macro... what else can I check?

@slgobinath
Copy link
Owner

It also has dependencies with libreoffice-script-provider-python. Most of the times it comes with LO.
Please make sure that you have this package.

@evacchi
Copy link
Author

evacchi commented Mar 14, 2018

unfortunately there is no such package on fedora. I did install libreoffice-pyuno which should be the same, though

@ruben1981
Copy link

ruben1981 commented May 18, 2018

In Fedora the python script provider for libreoffice is libobasis6.0-python-script-provider, not that one you put as a dependency. Please, add this one to dependencies, because all RedHat-derivated distros use this one.

@ruben1981
Copy link

ruben1981 commented May 25, 2018

SOLVED: just copy Pygments directory that you have in Python installation on your system, once you've installed it by pip, from the address "/usr/lib/pythonx.x.x/site-packages/" to "/path/to/libreoffice/program/python-core-x.y.z/lib/site-packages".
NB1: create the directory "site-packages" if there isn't in your libreoffice "../python-core-x.y.z/lib" directory;
NB2: Python version in LO hasn't to necessarily be the same than systemwide installed Python), so don't worry about it: just take Pygments from wherever you want.
NB3: you have to open a file manager in root mode. If you have KDE use Konqueror, because Dolphin can't be started in root mode due to some asspaining security feature
???
Profit

@baddwin
Copy link

baddwin commented Aug 3, 2018

hi @ruben1981 where is "/path/to/libreoffice/program/python-core-x.y.z/lib/site-packages"?
I don't find it in openSUSE where it should be in around /usr/lib64/libreoffice/program/ there's no python-core folder

@Callum-25252
Copy link

@ruben1981 's solution worked for me!

@colelamers
Copy link

I installed via Windows 10 with build 18362. I had an issue that was basically the same thing but it was referring to different lines on the python script mentioned. I can't replicate the exact issue now since I got it to work.

Anyway, another thing to mention like what @ruben1981 said, I'm assuming you also need the .oxt file in the same directory as the dependencies within the ...python-core-x.y.z\lib\site-packages\ folder.

So it should be under the path
...\LibreOffice\program\python-core-x.y.z\lib\site-packages\

And within that directory, it should be your pygments dependencies you downloaded, and codehighlighter.oxt.

Once I did that, my error went away and I was golden from there.

@gnull
Copy link

gnull commented Nov 19, 2020

"/path/to/libreoffice/program/python-core-x.y.z/lib/site-packages"

@ruben1981 Which path is this? I couldn't find anything like that in my /usr. I'm using standard LibreOffice installation from ArchLinux, but I believe paths should be the same as in some Ubuntu.

@PranavBhattarai
Copy link

PranavBhattarai commented Jan 15, 2021

I have also this problem in Ubuntu 20.10:
Screenshot from 2021-01-15 13-56-19
I wonder, why? I followed all steps and install all the required packages using commands:

sudo apt install libreoffice-writer
sudo apt install libreoffice-script-provider-python python3-pip
sudo pip3 install pygments
pip3 install pygments

It used to work fine. Don't know what happened.
LO: 7.0.3.1

#help

Edit:
Judging by the above discussion, I have this to say:
I have two folders:

  1. /usr/share/libreoffice/program
  2. /usr/lib/libreoffice/program

None of them include, python-core-x.y.z\lib\site-packages subfolder. Should I create one? Then where? In lib or share.

@bobylapointe69300
Copy link

bobylapointe69300 commented Mar 5, 2021

I have also this problem in Ubuntu 20.10:
Screenshot from 2021-01-15 13-56-19
I wonder, why? I followed all steps and install all the required packages using commands:

sudo apt install libreoffice-writer
sudo apt install libreoffice-script-provider-python python3-pip
sudo pip3 install pygments
pip3 install pygments

It used to work fine. Don't know what happened.
LO: 7.0.3.1

#help

Edit:
Judging by the above discussion, I have this to say:
I have two folders:

  1. /usr/share/libreoffice/program
  2. /usr/lib/libreoffice/program

None of them include, python-core-x.y.z\lib\site-packages subfolder. Should I create one? Then where? In lib or share.

Same here on Mint 20.1, but I could notice that when downloading this extension from libre office's website, the name was weird
ea4db15f_codehighlighter.oxt
I just renamed to codehighlighter.oxt, removed and re-installed and now everything is fine. I hope this helps.

Also had to use same commands:
sudo apt install libreoffice-writer
sudo apt install libreoffice-script-provider-python python3-pip
sudo pip3 install pygments
pip3 install pygments

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

9 participants