Ask Your Question

PythonNoob's profile - activity

2015-05-16 02:51:30 +0200 received badge  Famous Question (source)
2015-04-12 21:38:21 +0200 commented answer Observations on First Time Use

I think feedback and criticism are important - they help to evolve. However, I don't know if this is the right place, since the opening post is no question and probably won't reach the right audience.

2015-04-12 11:56:06 +0200 commented answer How can I use python requests or other 3rd party packages in general?

Yes, i edited the init file and it unfortunately didn't work. As a workaround I now call my standard python interpreter in a subprocess whenever I want to use 3rd party packages and use the libreoffice interpreter to access the uno api. This seems to work, though I hope it won't drag down perfomance too much... Thx alot for trying to help.

2015-04-12 09:29:05 +0200 received badge  Notable Question (source)
2015-04-11 11:24:56 +0200 commented answer How can I use python requests or other 3rd party packages in general?

No, unfortunately it didn't work. I tried before to simply copy the inner request-folder into site-packages, but it failed. I also tried to install pip with get-pip.py, but when I ran that, python.exe crashed.

2015-04-10 12:16:12 +0200 received badge  Popular Question (source)
2015-04-09 22:49:01 +0200 received badge  Editor (source)
2015-04-09 22:47:19 +0200 asked a question How can I use python requests or other 3rd party packages in general?

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: <class 'importerror'="">: 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 <module>() [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 <module>() [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!