How can I get the arcpy module to load in python 3.6?

48182
13
08-07-2017 07:45 AM
by Anonymous User
Not applicable

import arcpy

Does not work in 3.6 python.  I really need to get it to work or it's new version.  Very new to Python.

It's odd, when I look at installed programs, it says I have 3.6 python.  Running Python in a command window says it's 3.6.

However, when I open IDLE, it says it's using Python 2.7.8. 

Bit out of my element.  I'm a VB/JScript programmer.

Thanks

13 Replies
by Anonymous User
Not applicable

I only re-installed arcmap and then it works. 

HaroldKrivell
New Contributor III

Try typing the following...

import arcpy.mp

Python 3.x has changed the naming somewhat.

0 Kudos
JoshuaBixby
MVP Esteemed Contributor

Although arcpy.mapping became arcpy.mp with ArcGIS Pro/Python 3; the base package name is still arcpy, so if someone can't import arcpy they won't be able to import arcpy.mp.

0 Kudos
HenryLindemann
Esri Contributor

Hi Doug,

Python 2.7 is installed with ArcMap and Python 3.x is installed with ArcGIS Pro, because arcpy is proprietary you can't download it into a free standing installations of python you have to point to one of the deployments that is installed when installing ArcGIS for Desktop.

so just point your IDE to one of these deployments

ArcMap

"C:\Python27\ArcGIS10.8\python.exe"

ArcGIS Pro

"C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\python.exe"

You can have a look at the ArcGIS API which is a available for installation e.g. pip install ArcGIS to see if this might fill your need.

ArcGIS API for Python | ArcGIS for Developers

 

If you are using ArcGIS Desktop built in Python interpreter then just reinstall to try and fix the issue like @Anonymous User  mentioned.