Select to view content in your preferred language

Help to run Arcgis api for python and arcgis_learn on Google Colab!

2106
3
11-02-2022 11:25 AM
AsusSusa
New Contributor

I have been trying for days without being able to find a solution. I want to try arcgis notebook samples on google Colab but unfortunately it is complicated to install every single package. I have followed the instructions, created a conda environment, but when I import the modules there is always something that goes wrong. Do you have a sample notebook that works on Colab to share? My intention is to install version 2.0.1 and use the super resolution notebook. Please help me or tell me if it is not possible so I will give up.

 

 

Thank you in advance

 

3 Replies
dslamb2022
Occasional Contributor

I've used Colab in the past and like it a lot, but I have not really used the arcgis api with it. If I understand your question right, you're trying to get the library on Colab? You can use a lot of linux commands within the code cells. So you can install libraries there using pip. Unfortunately, you need to run this everytime you open the notebook.

 

 

!pip install arcgis==2.0.1

 

 
When I tried this, it took a long time to resolve the dependencies, so you might try running pip for some of the dependency packages first with their version number to reduce the installation time. https://developers.arcgis.com/python/guide/system-requirements/
 
 
It looks like you would also want to download a zip file. I like to store my files on the local google drive, and I think you should be able to do the same.
 
 

 

from google.colab import drive
drive.mount('/content/gdrive',force_remount=True)

 

 
After you verify the account:
 
 

 

%cd /content/gdrive/My Drive

 

 
or to some folder in your drive
 
 

 

%cd /content/gdrive/My Drive/SomeFolder

 

 
This will change the working folder to your drive, so files are downloaded there.
 
0 Kudos
DanPatterson
MVP Esteemed Contributor
0 Kudos
AsusSusa
New Contributor

I successfully managed to install api version 1.8.4 with torch=1.4.0 and fastai=1.0.60, thanks also to these commands

 https://github.com/Esri/arcgis-python-api/issues/1319

but I still can't install version 2.0.1.
Can anyone tell me which version of torch , torchvision and fastai,   arcgis 2.0.1requires through pip install?

 

Thanks everyone for the support!!!

0 Kudos