title: SQL Server python Machine Learning cannot access filesystem
body: <p>SQL Server 2017 using sp_execute_external_script (SQL Server Machine Learning) to run a python script in the context of the database. python script needs to load a file from filesystem. Everything (the database and the filesystem) is local on my PC. Error trace:</p>
  
  <p>Msg 39004, Niveau 16, État 20, Ligne 1</p>
  
  <p>Une erreur de script « Python » s'est produite lors de l'exécution de « sp_execute_external_script » avec HRESULT 0x80004004.</p>
  
  <p>Msg 39019, Niveau 16, État 2, Ligne 1</p>
  
  <p>Une erreur de script externe s'est produite :</p>
  
  <p>Error in execution.  Check the output for more information.</p>
  
  <p>Traceback (most recent call last):</p>
  
  <p>File "", line 5, in </p>
  
  <p>File "C:\PROGRA~1\MICROS~3\MSSQL1~2.MSS\MSSQL\EXTENS~1\MSSQLSERVER201701\B2E71FC7-8E08-4D86-8B82-38AD564DBC9D\sqlindb.py", line 43, in transform</p>
  
  <pre><code>im = Image.open(adresse_image)
  </code></pre>
  
  <p>File "C:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER2017\PYTHON_SERVICES\lib\site-packages\PIL\Image.py", line 2410, in open</p>
  
  <pre><code>fp = builtins.open(filename, "rb")
  </code></pre>
  
  <p>PermissionError: [Errno 13] Permission denied: 'C:\Users\aubertl\Downloads\plage_corse_2.jpg'</p>
  
  <p>SqlSatelliteCall error: Error in execution.  Check the output for more information.</p>
  
  <p>Message(s) STDOUT provenant du script externe :</p>
  
  <p>Express Edition will continue to be enforced.</p>
  
  <p>SqlSatelliteCall function failed. Please see the console output for more information.</p>
  
  <p>Traceback (most recent call last):</p>
  
  <p>File "C:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER2017\PYTHON_SERVICES\lib\site-packages\revoscalepy\computecontext\RxInSqlServer.py", line 406, in rx_sql_satellite_call</p>
  
  <pre><code>rx_native_call("SqlSatelliteCall", params)
  </code></pre>
  
  <p>File "C:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER2017\PYTHON_SERVICES\lib\site-packages\revoscalepy\RxSerializable.py", line 291, in rx_native_call</p>
  
  <pre><code>ret = px_call(functionname, params)
  </code></pre>
  
  <p>RuntimeError: revoscalepy function failed.</p>