I am developing a data import script tool for ArcGIS that downloads from an SQL Server into a pandas DataFrame. This python script worked perfectly as I built it in Spyder however now that I am setting it up in a Toolbox, ArcGIS cannot import pandas.
I have tried Installing pandas with Esri's python? on my own however what I am looking to do is automate the process so as soon as the tool is run the script checks for pandas and installs as necessary on any user's machine. I already fixed this similar problem with pypyodbc by storing the necessary setup scripts in the public drive folder where the tool script is located:
import os
import imp
path = os.path.realpath(__file__)
path = path[:-16]
os.chdir(path)
try:
imp.find_module('pypyodbc')
found = True
except ImportError:
found = False
if found == False:
import setup
import pypyodbc
I can't seem to apply this method to pandas as there isn't an install/setup script I can save in my public folder. Is there any way to automate the install of pandas from a Script Tool in ArcGIS?
Explore related questions
See similar questions with these tags.
pandas
from python. Once you know how to do this you should be able to do it from ArcGIS.