Hello,
I would like to run script in Python Command Prompt. I use arcgispro-py3. In Jupyter Notebook everything is ok. When I run script in Python Command Prompt I get message: "no module named gis".
I will be grateful for your help,
Robert
I got this same error, for a script that was working just fine in the past... hopefully this fix helps!
syntax error, unexpected WORD_WORD, expecting SCAN_ATTR or SCAN_DATASET or SCAN_ERRORcontext: <html^><head> <title>Home</title> <link href='https://community.esri.com/ESRI.ArcGIS.SDS.REST.css' rel='stylesheet' type='text/css'> <link rel='SHORTCUT ICON' href='https://community.esri.com/favicon.ico'><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <meta name="keywords" content="ArcGIS REST Services Directory Root"></head><body><table width="100%" class="userTable"><tr><td class="titlecell">ArcGIS REST Services Directory</td></tr></table><table class="navTable" width="100%"><tbody><tr valign="top"><td class="breadcrumbs"><a href="https://community.esri.com/1KtlSd2mklZMBKaz/ArcGIS/rest/services">Home</a> > <a href="https://community.esri.com/1KtlSd2mklZMBKaz/ArcGIS/rest/services">services</a> </td><td align="right"><a href="http://resources.arcgis.com/en/help/arcgis-rest-api/" target="_blank">API Reference</a></td></tr></tbody></table><table><tr><td class="apiref"><a href="?f=pjson" target="_blank">JSON</a></td></tr></table><div class='restHeader'><h2>Home</h2></div><div class='restBody'><div class="restErrors">Token Required<br/></div></div></body></html>syntax error, unexpected WORD_WORD, expecting SCAN_ATTR or SCAN_DATASET or SCAN_ERROR
Hi,
In my case, the ArcGIS Pro installation repair helped
Hi
I am having a similar issue. I can run the script fine in the python window in ArcPro but I when I try to run it in the Python Command Prompt I get the "ModuleNotFoundError: No Module named 'arcgis.gis'; arcgis is not a package" .
Thanks
Vicki Magnis
Atma Mani Rohit Singh are either of you monitoring threads?
This seems less ArcGIS api -ish, so you might want to move it or comment if it is
try forward slashes in the script path or enclose it in quotes.
Better still try my example script and see if it works.
or it could be something with your environment.
good luck
Thank you for your help,
Now I have:
(arcgispro-py3) E:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3>pythonE:\Scripts\script.pypodjazdysyntax error, unexpected WORD_WORD, expecting SCAN_ATTR or SCAN_DATASET or SCAN_ERRORcontext: <html^><head> <title></title> <link href='https://community.esri.com/ESRI.ArcGIS.SDS.REST.css' rel='stylesheet' type='text/css'> <link rel='SHORTCUT ICON' href='https://community.esri.com/favicon.ico'><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> </head><body><table width="100%" class="userTable"><tr><td class="titlecell">ArcGIS REST Services Directory</td></tr></table><table class="navTable" width="100%"><tbody><trvalign="top"><td class="breadcrumbs"><a href="https://community.esri.com/4hzb1jy75Vb5BbS1/ArcGIS/rest/services">Home</a> > <a href="https://community.esri.com/4hzb1jy75Vb5BbS1/ArcGIS/rest/services">services</a> > <a href="https://community.esri.com/4hzb1jy75Vb5BbS1/ArcGIS/rest/services/obiekty_niepelnosprawne/FeatureServer">obiekty_niepelnosprawne (FeatureServer)</a> </td><td align="right"><a href="http://resources.arcgis.com/en/help/arcgis-rest-api/" target="_blank">API Reference</a></td></tr></tbody></table><table><tr><td class="apiref"><a href="?f=pjson" target="_blank">JSON</a></td></tr></table><br/><br/><div class='restBody'><div class="restErrors">The requested layer (layerId: 0.dds) was not found.<br/></div></div></body></html>
I don't understand why in jupyter notebook everything is ok. I use the same enviroment. I also try use propy.bat. It is describe here: Run stand-alone scripts—ArcPy Get Started | ArcGIS Desktop
Here is an example of how to run a script from the command prompt
here is the script
<SPAN class="comment token"># -*- coding: utf-8 -*-</SPAN> <SPAN class="keyword token">from</SPAN> arcgis<SPAN class="punctuation token">.</SPAN>gis <SPAN class="keyword token">import</SPAN> GIS <SPAN class="keyword token">print</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">"hello"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
In the future I would like to run the script via Windows Server task scheduler, but I'm worried if it works if it does not work in Python Command Prompt.
I know that works in Jupyter notebook... I just tried it and it works in Jupyter QTconsole as well
So you will have to show your script if you are running it from the python prompt rather than running stuff in one of the IDE's that can be used with ArcGIS PRO
I have "from arcgis.gis import GIS", but problem is the same. In jupyter notebook is ok.
perhaps you script had something like this?
<SPAN class="keyword token">from</SPAN> arcgis<SPAN class="punctuation token">.</SPAN>gis <SPAN class="keyword token">import</SPAN> GIS<SPAN class="line-numbers-rows"><SPAN></SPAN></SPAN>
where GIS is capitalized.
Přihlášení členové mohou přispívat, sledovat aktualizace a další. Jste tu noví? Zaregistrujte si bezplatný účet.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.