No module named 'arcgis' for import GIS

7020
8
Jump to solution
08-20-2019 09:09 AM
MRReddy
Occasional Contributor

 I have ArcGIS API for Python installed and when I use below line, am getting error as

ModuleNotFoundError: No module named arcgis

from arcgis.gis import GIS

c

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
DanPatterson_Retired
MVP Emeritus
import sys

sys.executable

'C:\\Your_ArcGISPro_install_path\\bin\\Python\\envs\\arcgispro-py3\\pythonw.exe'

# ---- arcgis is installed in

# C:\Your_ArcGISPro_install_path\bin\Python\envs\arcgispro-py3\Lib\site-packages\arcgis‍‍‍‍‍‍‍‍‍

Do the sys.executable... if it isn't in the same path up and including

'C:\\Your_ArcGISPro_install_path\\bin\\Python\\envs\\arcgispro-py3

Then you are using the wrong python or arcgis was installed incorrectly.

Obviously Your_ArcGISPro_install_path will depend on your setup

View solution in original post

8 Replies
JoshuaBixby
MVP Esteemed Contributor

Can you elaborate on how you installed ArcGIS API for Python?

0 Kudos
MRReddy
Occasional Contributor

Joshua Bixby‌ Thank you for reply

I didn't install myself, my team member did, he said it comes with pro

and for import arcpy there is no error

Thanks

0 Kudos
JoshuaBixby
MVP Esteemed Contributor

ArcGIS Pro ships with 64-bit Python 3.6.8, and your screenshot shows 32-bit Python 3.7.3, so clearly this is not a typical/default installation.

MRReddy
Occasional Contributor

I logged in to My ArcgIS PRo, and in python section, i see version 1.4.1

is that right

Thanks

JoshuaBixby
MVP Esteemed Contributor

Please respond to Dan's question.  As Dan suspects, and I agree with, it seems you are running a different Python distribution than the one bundled with Pro, and the Python distribution you are running doesn't have ArcGIS API for Python installed.

0 Kudos
DanPatterson_Retired
MVP Emeritus
import sys

sys.executable

'C:\\Your_ArcGISPro_install_path\\bin\\Python\\envs\\arcgispro-py3\\pythonw.exe'

# ---- arcgis is installed in

# C:\Your_ArcGISPro_install_path\bin\Python\envs\arcgispro-py3\Lib\site-packages\arcgis‍‍‍‍‍‍‍‍‍

Do the sys.executable... if it isn't in the same path up and including

'C:\\Your_ArcGISPro_install_path\\bin\\Python\\envs\\arcgispro-py3

Then you are using the wrong python or arcgis was installed incorrectly.

Obviously Your_ArcGISPro_install_path will depend on your setup

MRReddy
Occasional Contributor

Dan

My arcgis pro installed path is 

C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3 

and i installed pthon 3.7.3 that path is C:\python3.7.3\

my pyscripter python version in pyscripter is

and my python path is to C:\python3.7.3\  Not the Pro installed path

i tried to add path (C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3 ) in pyscripter it gets added and when i ran the script and the settings agian changes to default

can you suggest me

Thanks

0 Kudos
DanPatterson_Retired
MVP Emeritus

That is a pyscripter problem, it isn't set up properly to use the required python.

0 Kudos