Ask Your Question
0

numpy in LibreOffice Calc

asked 2018-03-25 17:42:06 +0100

ERM gravatar image

updated 2018-03-25 17:43:48 +0100

I need to run python macros in LibreOffice Calc that require numpy. Unfortunately, the python version that comes with LibreOffice does not have numpy installed. I tried to install it, but failed (I am a Mac user). Has anyone been able to use numpy with LibreOffice Calc? If you have, please let me know how you managed. Thanks!

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2018-12-06 16:35:11 +0100

kak gravatar image

You may have figured it out by now, but in case not, I had been using numpy successfully in a Python calc macro (indirectly via an import of matplotlib.pyplot). Whenever I updated LibreOffice, I would copy several packages over, for example:

cp -r /anaconda/lib/python3.5/site-packages/numpy* /Applications/LibreOffice.app/Contents/Resources/

Since I was using numpy with matplotlib, these are the all the packages I had to copy over:

matplotlib
numpy
pyparsing
cycler
six
dateutil

I also added /anaconda/lib/python3.5/site-packages to the DYLD_FALLBACK_LIBRARY_PATH environment variable in my .bashrc file.

However, after recent updates of some python packages, I can't get past this error:

Message: <class 'ImportError'>: 
Importing the multiarray numpy extension module failed.  Most
likely you are trying to import a failed build of numpy.
If you're working with a numpy git repo, try `git clean -xdf` (removes all
files not under version control).  Otherwise reinstall numpy.

Original error was: cannot import name 'multiarray'
 (or 'type_check.*' is unknown)

I've tried several different versions of Python and the above packages using conda environments, but I've not gotten my macro to work again. I'd be interested to know if/how you solved your numpy issue, and with what versions of the above packages.

Thanks.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

2 followers

Stats

Asked: 2018-03-25 17:42:06 +0100

Seen: 124 times

Last updated: Dec 06