Select to view content in your preferred language

Arcpy import fail 10.3

5092
8
12-13-2015 04:04 PM
MarwanKheimi
Deactivated User

I am having this issue when I am using BG geoprocessing 64 bit

Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    import arcpy
  File "C:\Program Files (x86)\ArcGIS\Desktop10.3\ArcPy\arcpy\__init__.py", line 21, in <module>
    from arcpy.geoprocessing import gp
  File "C:\Program Files (x86)\ArcGIS\Desktop10.3\ArcPy\arcpy\geoprocessing\__init__.py", line 14, in <module>
    from _base import *
  File "C:\Program Files (x86)\ArcGIS\Desktop10.3\ArcPy\arcpy\geoprocessing\_base.py", line 598, in <module>
    env = GPEnvironments(gp)
  File "C:\Program Files (x86)\ArcGIS\Desktop10.3\ArcPy\arcpy\geoprocessing\_base.py", line 595, in GPEnvironments
    return GPEnvironment(geoprocessor)
  File "C:\Program Files (x86)\ArcGIS\Desktop10.3\ArcPy\arcpy\geoprocessing\_base.py", line 551, in __init__
    self._refresh()
  File "C:\Program Files (x86)\ArcGIS\Desktop10.3\ArcPy\arcpy\geoprocessing\_base.py", line 553, in _refresh
    envset = (set(env for env in self._gp.listEnvironments()))
RuntimeError: NotInitialized

not sure how I can solve this issue

on the other hand the 32 bit is working without any problems but at the same time I cannot use the 32 bit for the time being. therefore, I installed the BG geoprocessing 64 bit

0 Kudos
8 Replies
DanPatterson_Retired
MVP Emeritus

this error message suggests that part of your installation is incorrect.  If you look at the "more like this" links beside your post, you will find that it can be due to several things including where you are doing import arcpy (arcmap's IDLE, Pythonwin, Pyscripter etc) and/or your paths not be setting up correctly.  If this happened after you installed the background processing, then check the paths that were created there and make sure that access to the arcpy module can be reached.  As a side note, background processing seems to raise a whole load of other issues.  You might want to consider Installing ArcGIS Pro which gives you access to Python 3.4.x instead, for the most part, most scripts that comply with 3.4 syntax will work in a 2.7 environment (note...that does assume that you have familiarized yourself with the differences between 2.7 and 3.4)

RebeccaStrauch__GISP
MVP Emeritus

I have to second Dan's comment about background 64-bit for Desktop being a bit flakey. Personally, didn't find it was worth the effort to figure out the issues since 32-bit does seem to work fine, and as Dan mentioned, if true 64-bit is needed, Pro may be the way to go.

DanPatterson_Retired
MVP Emeritus

Did you resolve this?

0 Kudos
MarwanKheimi
Deactivated User

I still have the issue without resolving yet

0 Kudos
DanPatterson_Retired
MVP Emeritus

Then I would skip background processing until you can get a completely new install of arcmap with the associated python (perhaps 10.4) something has gone awry in your installation and tracking it down without a clean slate is really difficult

curtvprice
MVP Alum

In my humble opinion, a clear path to make sure your Python is "ArcGIS-clean" is to

1. Uninstall any Pythons you see in add-remove programs

2. make sure there are no python components in PATH or PYTHONPATH

3. Do a repair install of ArcGIS Desktop then x64 geoprocessing. (A full uninstall-reinstall of ArcGIS should be a last resort.) This will install or fix up Esri's shipped Python.

curtvprice
MVP Alum

I expanded this into a blog post Fixing broken Python

MarwanKheimi
Deactivated User

Thank you all for your responses

0 Kudos