I'm trying to upload a package to AWS Lambda and can not find/install the ArcGIS Python API for my package. Has anyone done this?
Figured this out...
Use Amazon EC2 and spin up a free tier Linux instance.
Install Python 3.6
Install Anaconda and use Conda to install the ArcGIS Modules
Zip up the install directory along with your Lambda_function.py file and upload it to Lambda (or s3)
Dependencies required for Lambda to work include ArcGIS, NumPy, Pandas and PyTz
Putty Tools were a good resource to work between Windows and Linux environments
Bill Major, Daniel Hunter -
My question is not just about Lambda, but also integrating this into a preexisting python environment.
Do you know where this is on the Windows Anaconda install? Anaconda is in C:\ProgramData\Anaconda3 by following the installer's default. There is a folder C:\ProgramData\Anaconda3\Lib\site-packages\arcgis with a bunch of .py scripts. Is that folder all I need to grab, or are there other entries written elsewhere (like a registry of modules)? Does the arcgis API imports other modules I need to get?
-- For Lambda, I assume I just drop the arcgis folder under my scripts and zip it up, does that sound right?
-- For the existing python, do I assume I just re-create whatever conda created. I see there is a tarball in the Esri Anaconda channel. Is that a better starting point? All I could find on GitHub (via Google) were training docs and samples.
These instructions from Esri should guide you.
install and set up | ArcGIS for Developers
For Lambda - I believe the package needs to be compiled in Linux environment for it to work properly. You'll need a linux machine to do so...you can create a new one on ec2.
For Existing Python - Virtual environments seem to be the way to go. Consider creating a new virtual environment and installing arcgis api through conda.
Nice work Daniel. I too recently went through this exercise. One thing you might consider for the future is to create a Python virtual environment, pip install numpy and pandas, and then copy the arcgis module into this folder. This way, the only thing in this folder than needs to be zipped up is /arcgis, /numpy, and /pandas; not the entire Anaconda install folder. This should significantly reduce your upload package.
One Question I would have is about the licensing, for example some of the scripts I would want to put in Lambda checkout extension. CheckOutExtension—Help | ArcGIS for Desktop
Does anyone know how this might look for Lambda since it would not have the ArcGIS License Manager Integration? This would be huge I think if there was a way.
Jon - I think you are looking for info on ArcPy. This thread is about Esri's other major Python API, called the "ArcGIS API for Python" (not a very creative name). ArcPy requires licensing, whereas the ArcGIS API for Python does not. That is more about working with server products, so you usually have to authenticate to the server, but you don't need any license to use the API itself.
Retrieving data ...