Hi everybody,
I am using Windows 8.1 and LibreOffice 4.4.2.2.
Scripting with the standard library of Python seems to work quite well, but I am having a hard time making the package “requests” work.
Since I couldn’t find pip or anything like that I downloaded the source directory into
C:\Program Files (x86)\LibreOffice 4\program
and executed within the source directory
“C:\Program Files (x86)\LibreOffice 4\program\python.exe setup.py install”,
which seemed to work at the first glance, but when I try to run the following script:
import ctypes, requests
def blabla(*args):
yahoo_url="http://download.finance.yahoo.com/d/quotes.csv?s=" + "+ABX+ALV.DE" +"&f=l1t1d1xphgkjva2m3m4on&e=.csv"
r = requests.get(yahoo_url)
ctypes.windll.user32.MessageBoxW(0, r.text, "Yahoo says:", 1)`
I get the following error message:
Ein Scripting Framework Fehler trat während der Ausführung vom Python-Skript vnd.sun.star.script:PyOffice|coco.py$blabla?language=Python&location=share auf. Meldung: : cannot import name utils C:\Program Files (x86)\LibreOffice 4\program\python-core-3.3.3\lib\site-packages\requests\__init__.py:58 in function () [from . import utils] C:\Program Files (x86)\LibreOffice 4\program\uno.py:265 in function _uno_import() [return _g_delegatee( name, *optargs, **kwargs )] C:\Program Files (x86)\LibreOffice 4\share\Scripts\python\PyOffice\coco.py:1 in function () [import ctypes, requests] C:\Program Files (x86)\LibreOffice 4\program\pythonscript.py:451 in function getModuleByUrl() [exec(code, entry.module.__dict__)] C:\Program Files (x86)\LibreOffice 4\program\pythonscript.py:992 in function getScript() [mod = self.provCtx.getModuleByUrl( fileUri )]
Thx in advance for any help!