Installing packages (e.g. Numpy) to LO python interpreter on MacOS

asked 2019-11-13 00:13:06 +0100

Dave123 gravatar image

I need to write a python script that makes use of a lot of libraries that are not included in LO python, but I can't get any packages installed. I'm using LO 6.2.8 on MacOS High Sierra 10.13.6. I do have two existing python installations on my system. A python 2 installation and one with python 3.7. When searching for the topic there is usually suggested to use pip install, which I always used before to install packages to my existing python installations. "$ pip install" seems to aim at my python 2 and "$ pip3 install" to my python 3.7 installation. Executing those does not affect LO python installation.

I tried 2 methods to install packages to the LO python. 1. Calling the LO python executable (with and without sudo) and using the pip module by: "$ sudo ./python -m pip install numpy" 2. Using pip from the running LO python shell by: import pip pip.main(['install', 'numpy'])

In both cases lumpy gets downloaded, but the installation always fails with: "distutils.errors.DistutilsPlatformError: invalid Python installation: unable to open /Applications/LibreOffice.app/Contents/Frameworks/LibreOfficePython.framework/lib/python3.5/config-3.5m/Makefile (No such file or directory)"

The Makefile does exist in the directory though. Reinstalling LO did not help either. Any help would be highly appreciated.

edit retag flag offensive close merge delete

Comments

1

I am develop an extension for admin PIP in LibreOffice. I can test in Linux and Windows, you can see a video.

I tested install numpy correctly. You can test install it and help me tested this extension in MAC.

Best regards

mauricio gravatar imagemauricio ( 2019-11-13 02:37:12 +0100 )edit

I followed your instruction in the video and installed your extension. When opening it, it tells me pip is not installed yet, same as in your video. When trying to use the install function it gives me an error. pip is downloaded, but the installation fails with the following error message: File “/Applications/LibreOffice.app/Contents/Resources/../Resources/..Frameworks/LibreOfficePython.framework/Versios/Current/lib/python3.5/site.py”, line 176 file=sys.stderr)

SyntaxError: invalid syntax

Dave123 gravatar imageDave123 ( 2019-11-13 11:42:30 +0100 )edit

Thank, I'm going to try to get a MAC to debug this error.

mauricio gravatar imagemauricio ( 2019-11-13 16:10:39 +0100 )edit