Add libraries to ArcGIS Notebook Server

232
2
09-15-2021 05:01 PM
Labels (1)
GWaltersOZ
New Contributor III

Hi all, 

We are currently running Portal 10.7.1 on premise, all windows environment, except for the Jupyter Notebook server.

We have a really simple problem to solve. We want to connect our other SQL Server databases and bring the data into a pandas table. We use sqlalchemy but it returns errors that no submodule of pyodbc or pymysql exists. Obviously I then check the libraries document and I can't see them. 

GWaltersOZ_0-1631750632841.png

 

Apart from using an ETL and transferring data to a GDB or some other file or is there a different library we should be using?

Our linux system administrator couldn't get the libraries to load within the standard notebook "image" (esri precompiled deployment). Is there something we are missing?

Appreciate any feedback and a solution will be even better :)

Cheers,

Gareth

 

0 Kudos
2 Replies
WilliamOrr
New Contributor II

Hi Gareth 

Have you used pip to install pymysql?

I've had success connecting to MS SQL using pyodbc, but I think that also needed to be installed via pip. 

HTH

William

0 Kudos
ReeseFacendini
Esri Contributor

To add to @WilliamOrr 's comment, when running code that uses python libraries not included in the Notebook runtime, you need to have a section at the beginning of your code to re-import the library because it won't be saved after the notebook finishes running

0 Kudos