<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Run a Python Script saved online in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/run-a-python-script-saved-online/m-p/1227247#M7954</link>
    <description>&lt;P&gt;I tried doing "pip install arcgis" at Pythonanywhere and it used my apparently tiny allocation of CPU seconds and says I have to wait 24 hours to get more. HA ha ha! Well, it's free!&lt;/P&gt;&lt;P&gt;I keep a virtual machine at Tektonic.net. But you just get a command prompt there so you have to know Linux commands. On the other hand I get the resources I need for $4/month. Vultr.com is popular too but a few $ more.&lt;/P&gt;&lt;P&gt;I have already installed conda there, so something like this gets arcgis installed and usable for me,&lt;/P&gt;&lt;LI-CODE lang="c"&gt;# This creates an environment and installs python, arcgis module, and jupyter notebooks
conda create --name=arcgis -c esri arcgis jupyter
# This activates the environment
conda activate arcgis
# Now you can start Jupyter, and you can start typing Python interactively.
jupyter console&lt;/LI-CODE&gt;&lt;P&gt;Then I can start typing in commands like "from arcgis.gis import GIS"... or I can copy a script up there and run it instead with "python myscript.py"&lt;/P&gt;&lt;P&gt;My new "arcgis" environment stays up there on the virtual machine, ready to go whenever I need it, I just have to issue the command "conda activate arcgis" to load it.&lt;/P&gt;&lt;P&gt;Normally to run a tiny web server to run some Python I would use Flask. I can also run my own Jupyter Notebook server. This is quite a bit cheaper than a license for the ArcGIS Notebook server. So for me, it is worth the extra learning curve problems of working at the command line.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 31 Oct 2022 20:09:31 GMT</pubDate>
    <dc:creator>Brian_Wilson</dc:creator>
    <dc:date>2022-10-31T20:09:31Z</dc:date>
    <item>
      <title>Run a Python Script saved online</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/run-a-python-script-saved-online/m-p/1227227#M7953</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have a Python script that access ArcGIS Online and perform a couple of operations in a Feature Layer.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have only Basic ArcGIS License.&lt;/P&gt;&lt;P&gt;My idea is to save this script online, somewhere, for example, &lt;A href="https://www.pythonanywhere.com" target="_self"&gt;in this website&lt;/A&gt;&amp;nbsp;and allow the user to, by clicking in a link, execute the script.&lt;/P&gt;&lt;P&gt;The problem is that the scripts uses the following libraries:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;from arcgis.gis import GIS&lt;BR /&gt;from &lt;/SPAN&gt;arcgis.geometry &lt;SPAN&gt;import &lt;/SPAN&gt;Geometry&lt;BR /&gt;&lt;SPAN&gt;from &lt;/SPAN&gt;arcgis.geometry.filters &lt;SPAN&gt;import &lt;/SPAN&gt;intersects&lt;/PRE&gt;&lt;P&gt;I have installed the libraries with Conda:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://support.esri.com/en/technical-article/000022005" target="_blank" rel="noopener"&gt;https://support.esri.com/en/technical-article/000022005&lt;/A&gt;&lt;/P&gt;&lt;P&gt;But I do not know if or how can I upload these libraries to this online websites. It is possible?&lt;/P&gt;</description>
      <pubDate>Mon, 31 Oct 2022 20:09:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/run-a-python-script-saved-online/m-p/1227227#M7953</guid>
      <dc:creator>AngelRomoSandoval</dc:creator>
      <dc:date>2022-10-31T20:09:28Z</dc:date>
    </item>
    <item>
      <title>Re: Run a Python Script saved online</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/run-a-python-script-saved-online/m-p/1227247#M7954</link>
      <description>&lt;P&gt;I tried doing "pip install arcgis" at Pythonanywhere and it used my apparently tiny allocation of CPU seconds and says I have to wait 24 hours to get more. HA ha ha! Well, it's free!&lt;/P&gt;&lt;P&gt;I keep a virtual machine at Tektonic.net. But you just get a command prompt there so you have to know Linux commands. On the other hand I get the resources I need for $4/month. Vultr.com is popular too but a few $ more.&lt;/P&gt;&lt;P&gt;I have already installed conda there, so something like this gets arcgis installed and usable for me,&lt;/P&gt;&lt;LI-CODE lang="c"&gt;# This creates an environment and installs python, arcgis module, and jupyter notebooks
conda create --name=arcgis -c esri arcgis jupyter
# This activates the environment
conda activate arcgis
# Now you can start Jupyter, and you can start typing Python interactively.
jupyter console&lt;/LI-CODE&gt;&lt;P&gt;Then I can start typing in commands like "from arcgis.gis import GIS"... or I can copy a script up there and run it instead with "python myscript.py"&lt;/P&gt;&lt;P&gt;My new "arcgis" environment stays up there on the virtual machine, ready to go whenever I need it, I just have to issue the command "conda activate arcgis" to load it.&lt;/P&gt;&lt;P&gt;Normally to run a tiny web server to run some Python I would use Flask. I can also run my own Jupyter Notebook server. This is quite a bit cheaper than a license for the ArcGIS Notebook server. So for me, it is worth the extra learning curve problems of working at the command line.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Oct 2022 20:09:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/run-a-python-script-saved-online/m-p/1227247#M7954</guid>
      <dc:creator>Brian_Wilson</dc:creator>
      <dc:date>2022-10-31T20:09:31Z</dc:date>
    </item>
    <item>
      <title>Re: Run a Python Script saved online</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/run-a-python-script-saved-online/m-p/1227248#M7955</link>
      <description>&lt;P&gt;I should also mention, the commands shown here work on a Windows machine, so you can get started testing and running code locally on a Desktop and once you have something working you can copy the Python up to the virtual machine. I use Visual Studio Code on my desktop to run code both locally and remotely -- you can set up a session and run a Jupyter notebook using the local desktop or using the remote virtual machine.&lt;/P&gt;</description>
      <pubDate>Mon, 31 Oct 2022 20:13:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/run-a-python-script-saved-online/m-p/1227248#M7955</guid>
      <dc:creator>Brian_Wilson</dc:creator>
      <dc:date>2022-10-31T20:13:05Z</dc:date>
    </item>
    <item>
      <title>Re: Run a Python Script saved online</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/run-a-python-script-saved-online/m-p/1227287#M7956</link>
      <description>&lt;P&gt;Searching for ways to host Python online for free (or cheap), I found Binder.&lt;/P&gt;&lt;P&gt;&lt;A title="&amp;quot;Turn a Git repo into a collection of interactive notebooks&amp;quot;" href="https://mybinder.org/" target="_blank" rel="noopener"&gt;Binder&lt;/A&gt;&amp;nbsp;is not exactly what you're asking for but very cool. They let you upload and run notebooks, apparently 100% for free. It looks like it is a project of the Leibniz Institute for Social Sciences.&lt;/P&gt;&lt;P&gt;To load my test project, I set up a simple project and then saved it to a git repository and then fed the URL to mybinder.org&lt;/P&gt;&lt;P&gt;My code is at &lt;A href="https://github.com/brian32768/hello-binder" target="_blank"&gt;https://github.com/brian32768/hello-binder&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You can try running it here &lt;A href="https://mybinder.org/v2/gh/brian32768/hello-binder/main?labpath=index.ipynb" target="_blank" rel="noopener"&gt;https://mybinder.org/v2/gh/brian32768/hello-binder/main?labpath=index.ipynb&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I set it up in Visual Studio Code and it will show me the map there, sadly it does not show up in Binder. But you asked if you could run geometry operations so I added a cell for that. Yes, it worked.&lt;/P&gt;&lt;LI-CODE lang="c"&gt;from arcgis.geometry import Geometry, Point
from arcgis.geometry.filters import intersects
pt = Point({"x":-123, "y":46.6, "spatialReference": {"wkid":4326}})
print(pt)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Oct 2022 22:36:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/run-a-python-script-saved-online/m-p/1227287#M7956</guid>
      <dc:creator>Brian_Wilson</dc:creator>
      <dc:date>2022-10-31T22:36:04Z</dc:date>
    </item>
    <item>
      <title>Re: Run a Python Script saved online</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/run-a-python-script-saved-online/m-p/1227289#M7957</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="screenshot from Binder" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/54908i44CA4AD3FEF606B9/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2022-10-31 153705.png" alt="screenshot from Binder" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;screenshot from Binder&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Oct 2022 22:37:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/run-a-python-script-saved-online/m-p/1227289#M7957</guid>
      <dc:creator>Brian_Wilson</dc:creator>
      <dc:date>2022-10-31T22:37:56Z</dc:date>
    </item>
    <item>
      <title>Re: Run a Python Script saved online</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/run-a-python-script-saved-online/m-p/1229201#M7977</link>
      <description>&lt;P&gt;Thank you for all the info, BrianWilson7,&lt;/P&gt;&lt;P&gt;I do not have so much knowledge as you, so I am not able to follow all your different methods, I am trying now with the last one: Git-Hub + Binder, but I think that it does not work for me because I need to have an open Gibthub repository and I need it to be Private.&lt;/P&gt;&lt;P data-unlink="true"&gt;I have also tried on my own&amp;nbsp;&lt;A href="https://replit.com/" target="_self"&gt;Replit&lt;/A&gt;&amp;nbsp;&amp;nbsp;but when I tried to load the ArcGIS API for Python packages I get always an error. This option would be the perfect because I can have all private and I can trigger the script from anywhere.&lt;/P&gt;&lt;P data-unlink="true"&gt;Also I have created a Notebook in ArcGIS Online that is run each 15 minutes, but there is no option, as far as I know, to be able to have somewhere a link to trigger the script.&lt;/P&gt;&lt;P data-unlink="true"&gt;Thank you anyway for your help,&lt;/P&gt;&lt;P data-unlink="true"&gt;Angel&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2022 09:03:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/run-a-python-script-saved-online/m-p/1229201#M7977</guid>
      <dc:creator>AngelRomoSandoval</dc:creator>
      <dc:date>2022-11-08T09:03:48Z</dc:date>
    </item>
  </channel>
</rss>

