title: Error in calling a Python script from a Basic function
body: <p>I am new in Python and Basic. I am trying to replicate the IMPORTHTML function from Google Sheets in LibreOffice (LO) Calc. In a nutshell, I want to create a GetHtmTable( Url, Table Index) Basic function in Calc which will call a Python script to do the heavy work.</p>
  
  <p>So based on Villeroy's <a href="https://forum.openoffice.org/en/forum/viewtopic.php?f=45&amp;t=73145&amp;p=329658" rel="nofollow noreferrer">great example</a>, I implemented in LO 5.1.6.2. the Basic <em>SOUNDEX</em> function which calls the Python script <code>sheetFunctions.py</code> to get familiar with the process. My environment is Linux Mint 18, I use Python 3, I imported all kind of libraries such as Uno, PIP etc.. I use <code>PycharmProjects</code> as a Python editor. </p>
  
  <p>I see clearly under the LO Calc menu tools->macro->organize macros->python the <code>sheetFunctions.py</code> Python script, which indeed is in the folder <code>/usr/lib/libreoffice/share/Scripts/python</code>.</p>
  
  <p>Whenever, I run the SOUNDEX Basic function I see the following error message:</p>
  
  <blockquote>
    <p>BASIC runtime error. An exception occurred  Type:
    com.sun.star.script.provider.ScriptFrameworkErrorException Message:
    : an
    error occurred during file opening<br>
    /usr/lib/libreoffice/program/pythonscript.py:429 in function
    getModuleByUrl() [lastRead = self.sfa.getDateTimeModified( url )]<br>
    /usr/lib/libreoffice/program/pythonscript.py:993 in function
    getScript() [mod = self.provCtx.getModuleByUrl( fileUri )]</p>
  </blockquote>
  
  <p>I tried to debug the SOUNDEX basic function and found out the blocking point is when the program runs <code>getScript("vnd.sun.star.script:sheetFunctions.py$soundex?language=Python&amp;location=user")</code>.</p>
  
  <p>I've been trying for days now to overcome this error, unsuccessfully I must confess.</p>
  
  <p>I wonder if I need to bring some extra extensions in the Basic environment or a missing add-in in the Linux/Python one?</p>
  
  <p>I changed the <em>location=user</em> by <em>location=document</em> and got stuck again. I added recently libreoffice-script-provider-python thanks to the command <code>sudo apt-get install libreoffice-script-provider-python</code> but this did not help. I also embedded in the Calc document the Python script but same this did not solve the issue.</p>