cmallwitz / Financials-Extension

Extension for LibreOffice Calc to access stock market data
Other
137 stars 17 forks source link

LibreOffice 7 - Pip - Extension - Windows 10 #18

Closed omoknen closed 3 years ago

omoknen commented 3 years ago

FYI: Installing LibreOffice 7 breaks installing PIP using "get-pip.py" on Windows 10 and therefore the extension will not work. At least one person has mentioned it there, so everyone be careful.

GeorgesPaul commented 3 years ago

Yep, I upgraded to LibreOffice 7.1 and this extension is now broken. Very unfortunate.

It's beyond me why they wouldn't ship pip with LibreOffice's Python? Doesn't literally everybody need it who uses extensions?!

omoknen commented 3 years ago

Sorry I forgot to put this up sooner.  I have to make this quick.

https://bugs.documentfoundation.org/show_bug.cgi?id=140236 https://bugs.documentfoundation.org/show_bug.cgi?id=140236

https://github.com/pypa/get-pip/issues/98 https://github.com/pypa/get-pip/issues/98

TLDR; It is a LibreOffice problem.  The guy who reported it has a temporary fix.  The temporary fix does work. I had my own copy of Python for something else, and was able to use my copy of "libffi-7.dll"

Copy "libffi-7.dll" into your "...\LibreOffice\program\python-core-3.8.4\lib" directory and pipya will work.

On 3/4/2021 1:39 PM, GeorgesPaul wrote:

Yep, I upgraded to LibreOffice 7.1 and this extension is now broken. Very unfortunate.

It's beyond me why they wouldn't ship pip with LibreOffice's Python? Doesn't literally everybody need it who uses extensions?!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/cmallwitz/Financials-Extension/issues/18#issuecomment-790925408, or unsubscribe https://github.com/notifications/unsubscribe-auth/AF6JAJBE42MFCPHKLUS4LTDTB7VWNANCNFSM4X6AOTXQ.

GeorgesPaul commented 3 years ago

wow, thanks for the quick and helpful reply. This fixes pip, but the next problem I ran into is that it won't install dateutil with pip install dateutil (as suggested by the error when trying to load the Calc extension).

The fix is to type "pip install python-dateutil" instead of just dateutil. Maybe error message can be changed from saying the dateutil package is required to saying the python-dateutil package is required?

It works now. Although I still can't understand why Calc wouldn't ship with pip by default on Windows, but that's for another github repo I guess :P

omoknen commented 3 years ago

New version of LibreOffice is out, you might try that.  You will have to reinstall pip and everything else again as usual during updates. I didn't have a problem so I hope this helps.

On 3/5/2021 3:49 AM, GeorgesPaul wrote:

wow, thanks for the quick and helpful reply. This fixes pip, but the next problem I ran into is that it won't install dateutil (the other Python modules install just fine though)...

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/cmallwitz/Financials-Extension/issues/18#issuecomment-791340480, or unsubscribe https://github.com/notifications/unsubscribe-auth/AF6JAJG2C75QEXXPFIJC3KDTCCZJ5ANCNFSM4X6AOTXQ.

GeorgesPaul commented 3 years ago

New version of LibreOffice is out, you might try that. You will have to reinstall pip and everything else again as usual during updates. I didn't have a problem so I hope this helps. On 3/5/2021 3:49 AM, GeorgesPaul wrote: wow, thanks for the quick and helpful reply. This fixes pip, but the next problem I ran into is that it won't install dateutil (the other Python modules install just fine though)... — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <#18 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AF6JAJG2C75QEXXPFIJC3KDTCCZJ5ANCNFSM4X6AOTXQ.

Thanks for the heads up. I got Calc working now with the fix you suggested. I don't think I'll be upgrading LibreOffice again until they decide to ship it with pip :P Upgrading is wayyyyyyyyyyy too much of a hassle this way.

cmallwitz commented 3 years ago

It certainly sounds messy. With python always a bit temperamental about library dependencies (e.g. numpy/scipy/pandas etc) I was actually thinking about using https://docs.python.org/3/library/zipapp.html to bundle the extension and include all dependencies (only the three/four modules you may now have to "pip" install). Then the local python could be bare bone without pip and any manual steps required.

GeorgesPaul commented 3 years ago

It certainly sounds messy. With python always a bit temperamental about library dependencies (e.g. numpy/scipy/pandas etc) I was actually thinking about using https://docs.python.org/3/library/zipapp.html to bundle the extension and include all dependencies (only the three/four modules you may now have to "pip" install). Then the local python could be bare bone without pip and any manual steps required.

That sounds like a great idea to work around the LibreOffice "bare" Python issue. IMO priority number 1 for adoption of tools like these is user friendliness: I personally feel you can't ask much more from an average Excel/Calc user than "go to extension manager and install the file you just downloaded".

Until LibreOffice fixes their Python issue, this would be great. Having to install Python modules for 1 of the many interpreters on a system (after bootstrapping pip on it) is really like 2 bridges to far for the average user I feel.

cmallwitz commented 3 years ago

Only reason I'm hesitant is that it could open up another can of worms where I bundle some package and it doesn't work on the python binaries used by Calc but the "pip" version would. But I think I will take a look as the "pip" installation step is a pain..

GeorgesPaul commented 3 years ago

That's cool! I'll finally be able to explain to friends and family how they can get "live" finance data in Calc :D

cmallwitz commented 3 years ago

If anybody wants to try the new version 3.0.0 - it packages the required Python dependencies and it should no longer be necessary to change anything in LibreOffice (e.g. installing with pip)

GeorgesPaul commented 3 years ago

Amazing! Works instantly and way way easier and quicker to install!!

Was it hard to set up with zipapp? If not, I'll probably use it for future projects myself as well.

cmallwitz commented 3 years ago

I looked at zipapp et all and they seemed to be fairly straightforward but the LibreCalc extension is itself a zip archive that gets unpacked on installation. So the extension build processed now pulls a fixed number of dependcies directly from the pip servers. This seems to work so I left it at that stage.

cmallwitz commented 3 years ago

closing issue - new version should make all of this obsolete.