cmallwitz / Financials-Extension

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

where is the .oxt file? #32

Closed vijaysaxena99 closed 2 years ago

vijaysaxena99 commented 2 years ago

I am new to github and a non-programmer for all practical purposes. Landed here trying to read an investment portfolio tracking spreadsheet (.xls) into LibreOffice Calc because I don't want to buy MS Office any more and Google Sheet is not private.

Under the Usage heading it says: "Under 'Releases' on GitHub there is downloadable Financials-Extension.oxt file - load it into Calc under menu item: Tools, Extension Manager..."

I can't find this extension file, or even 'Releases' on GitHub! Could someone please post a version for Windows 10 and post a download link here? Thank you.

(my programming background is programming complicated math in FORTRAN. I know I am an old foagie...)

cmallwitz commented 2 years ago

Here: https://github.com/cmallwitz/Financials-Extension/releases

vijaysaxena99 commented 2 years ago

Thanks, cmallwitz! I tried adding this extension using Extension Manager in LibreOffice and get the following error: Screenshot 2021-08-17 163118

I did check in my folders and can confirm that 'financial.py' does not exist.

vijaysaxena99 commented 2 years ago

I am using LibreOffice version 7.0.6.2 (x64). Are you able to help?

cmallwitz commented 2 years ago

Unfortunately the lowest version of LibreOffice on Windows I currently have access to is 7.1.2.2 but IIRC there where reports that the Python support in 7.0.x.x had some issues on Windows. Could you try upgrading your LO to a newer version?

vijaysaxena99 commented 2 years ago

I am using LibreOffice version 7.0.6.2 (x64). Are you able to help?

vijaysaxena99 commented 2 years ago

Installed version 7.1.5.2 (x64) And tried adding the Extension. Same Error: missing Financials.py file in Financials-Extension.oxt folder

Screenshot 2021-08-18 122457

In the Extension Manager, Financial Market Extension 3.0.3 is grey-ed out and says: "Error. The status of this extension is unknown.

Screenshot 2021-08-18 123010

vijaysaxena99 commented 2 years ago

Do I need to install a Python runtime environment in Windows 10?

cmallwitz commented 2 years ago

I would not expect a Python installation necessary. My LO on Windows came with a python.exe in "c:\Program Files\LibreOffice\program" Prior to version 3.0.0 of this extension you would have to install a view additional public modules in the Python libraries folder in the same location but since 3.0.0 everything comes with the extension

cmallwitz commented 2 years ago

Is there anything under the folder c:\User\Vijay\AppData\Roaming\LibreOffice\4\user\uno_packages\cache\uno_packages ?

So the LO extension manager calls the extension once after unpacking - that seems to fail because the extension isn't actually there. That leads to the status unknown as well.

I'm a bit clueless why it wouldn't even unpack the extension as if the disk is full or there is a permission issue writing to that folder.

vijaysaxena99 commented 2 years ago

2 items:

  1. You wrote,"My LO on Windows came with a python.exe in c:\Program Files\LibreOffice\program" My LO installation also has python.exe in the same location:

Screenshot 2021-08-18 151335

In addition there is another python.exe in ...Program Files\LibreOffice\program\python-3.8.8-core\bin

Screenshot 2021-08-18 151403

  1. You asked if "c:\User\Vijay\AppData\Roaming\LibreOffice\4\user\uno_packages\cache\uno_packages" has anything. The contents are lited in screenshot below:

Screenshot 2021-08-18 151526

cmallwitz commented 2 years ago

This bizarre - so the extension got unpacked and the file "financials.py" (lower case) is right there in the middle of your last screen shot. Why would LO/Python say "No such file or directory" as if it would actually be missing? Can you try opening in e.g. notepad to make sure it is readable?

vijaysaxena99 commented 2 years ago

yes financials.py is readable file in Notepad. looks like code. In fact I checked all python files in that folder; they are all readable.

Has it something to do with permissions? But I did install LO as well as this extension under my id on my laptop and i do have admin privileges!

vijaysaxena99 commented 2 years ago

Yes, the financials.py file is readable in Notepad. Looks like code. In fact, I checked all .py files in that folder and they are all readable. re permissions, I installed LO under my id in my laptop. It has admin privileges. (The laptop has couple other id's but they are unused). All other sw installed under my id works!

May be the problem is not with the financials.py file not existing but how pythonloader is reading it? It is complaining about two particular lines in pythonloader: 93 and 146. something to do with 'geturl'. See the traceback paths in my error message posted earlier...

cmallwitz commented 2 years ago

I'm really lost why reading the file from disk would fail. If you can see the content in Notepad than LO/Python launched by you should be as well (admin rights or not)

re: regarding the details of the error message: obviously I can't access your box but you version of pythonloader.py should be this https://github.com/LibreOffice/core/blob/libreoffice-7.1.5.2/pyuno/source/loader/pythonloader.py

As you can see, the offending line 93 contains the call to the Python build-in open() function that is claiming "No such file or directory"

I'm almost inclined to ask you to try and install any LO extension just as a test e.g. as described here: https://www.libreofficehelp.com/beginners-guide-install-libreoffice-extensions/ (with examples) which can be removed afterwards. This should trigger the same call stack from pythonloader.py to the extension code.

vijaysaxena99 commented 2 years ago

I was able to successfully download and install 2 extensions: codel highlighter 1.6, and CalCalc

vijaysaxena99 commented 2 years ago

perhaps you could test installing the financial extension on a spare PC-- following the same steps as i did, starting from downloading from the link you posted earlier in this chain?

vijaysaxena99 commented 2 years ago

I was able to install financial extension in Calc! At Last!!

The issue was that when downloading & saving it into my Downloads folder, I had re-named it LO-Financials-extension.oxt. And then pointed to it while installing it in Extension Manager.

I usually rename downloaded sw files to let me remember what these are. This has never caused issues before.

Just for experiment, I renamed CalCalc extension file LO-CalCalc.oxt and got the same error while trying to install this extension.

Perhaps include a warning in your write up (for newbies to LO like me)?

vijaysaxena99 commented 2 years ago

just FYI: check out this solution to importing stock prices into LO Calc, posted by jampod. halfway down. Seems like a very straighforward solution. Haven't tried it myself yet

cmallwitz commented 2 years ago

Ah - now that we have found the issue, it can be seen in the error message as well where the file LO is looking for is in directory "LibreOffice Financials-Extension.oxt" when in fact it should be in "Financials-Extension.oxt" - good! sanity partially restored

I will see to getting a comment added on my "readme" file to warn people.

re: the Google spreadsheet based solution mentioned by jampod - this takes multiple steps and tools so is a hassle if you want to automatically update data in LO. With my extension, you set everything up and then just press CTRL-SHIFT-F9 in LO calc and it refreshs. I will advertise my extension there to get some feedback from people :-)

cmallwitz commented 2 years ago

Closing this in meantime...