No module named gis

4803
15
07-25-2018 04:18 AM
RobertKnapik
New Contributor III

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

Tags (2)
15 Replies
RobertKnapik
New Contributor III

Thank you for your help,

Now I have:

(arcgispro-py3) E:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3>python
E:\Scripts\script.py
podjazdy
syntax error, unexpected WORD_WORD, expecting SCAN_ATTR or SCAN_DATASET or SCAN_
ERROR
context: <html^><head> <title></title> <link href='https://community.esri.com/ESRI.ArcGIS.SDS.REST.css' re
l='stylesheet' type='text/css'> <link rel='SHORTCUT ICON' href='https://community.esri.com/favicon.ico'><m
eta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> </head><body>
<table width="100%" class="userTable"><tr><td class="titlecell">ArcGIS REST Serv
ices Directory</td></tr></table><table class="navTable" width="100%"><tbody><tr
valign="top"><td class="breadcrumbs"><a href="https://community.esri.com/4hzb1jy75Vb5BbS1/ArcGIS/rest/serv
ices">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/Feature
Server">obiekty_niepelnosprawne (FeatureServer)</a> </td><td align="right"><a hr
ef="http://resources.arcgis.com/en/help/arcgis-rest-api/" target="_blank">API Re
ference</a></td></tr></tbody></table><table><tr><td class="apiref"><a href="?f=p
json" 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 

0 Kudos
DanPatterson_Retired
MVP Emeritus

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

0 Kudos
DanPatterson_Retired
MVP Emeritus

Atma ManiRohit 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

0 Kudos
ViktoriaMagnis
New Contributor II

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

0 Kudos
RobertKnapik
New Contributor III

Hi,

In my case, the ArcGIS Pro installation repair helped

Robert

0 Kudos
CaraMoore
New Contributor II

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_ERROR
context: <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

0 Kudos