-
Notifications
You must be signed in to change notification settings - Fork 16
How to use the extension with OpenOffice on macOS Sierra #10
Comments
I have the same problem in macOS Mojave and I don't have much experience on Python:
I checked Python 2.7.10 is already installed in Things I've tried but no luck: Are there any simple installation instruction like using Homebrew? |
ok, may be you have not pip or a second version (3). Open the console and type pip, than type tab twice: it shows you all the resolution for that string, for me: max$ pip⟶⟶
pip pip-2.7 pip-autoremove pip2 pip2.7 pip3 pip3.7
max$ pip Then use pip2.7: max$ sudo pip2.7 install pygments Actually pip could be linked up to pip3.7, for me it is: max$ pip -V
pip 19.1.1 from /usr/local/lib/python3.7/site-packages/pip (python 3.7)
max$ pip2.7 -V
pip 19.0.3 from /usr/local/lib/python2.7/site-packages/pip (python 2.7) But if the tab don't show up any pip command, you don't have it installed yet. So install it first and than install pygments. $ sudo easy_install pip
$ sudo pip install --upgrade pip |
Yes I have pip2.7 installed,
So it seems to be already installed successfully, but in LibreOffice still showing the same error:
|
ok, here is the problem: this trhead is about OpenOffice. Actually OpenOffice uses macOs Python installation, while LibreOffice don't. It uses a custom install of Python just inside the .app package. I wrote the same instruction for LibreOffice in the referenced issue, let's have a look at #14 too. You should launch Python from inside LibreOffice.app $ sudo /Applications/LibreOffice.app/Contents/Resources/python and then execute these lines of code >>> import pip
>>> pip.main(['install', 'pygments']) |
hi,
this extension works in OpenOffice on macOS Sierra too but you need to install pygments in the right python environment. Actually I've some python installed while OpenOffice uses the official macOS one, i.e. python 2.7, so in the console type pip and then to tab key twice to obtain all the pip available, for me is pip-2.7. Now you can install pygments with a command:
and all works fine.
In case of dubt, you have to modify a python script like HelloWorld.py located in the folder /Applications/OpenOffice.app/Contents/share/Scripts/python and add before return
Than execute HelloWorld from Writer to see where the OpenOffice python loads imports and particulary where is site_packages located. From that info you should find the right python and pip.
hope this helps.
max
The text was updated successfully, but these errors were encountered: