<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: &amp;quot;arcpy module does not exist&amp;quot; in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/amp-amp-quot-arcpy-module-does-not-exist-amp-amp/m-p/439157#M34478</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;A source outside the forum, a Mr. Callahan, assisted me with this problem. It turns out that Python 2.7 and the 2.7 Numpy and Scipy packages I had installed as well were interfering with the call to arcpy for some reason. Once I uninstalled Python 2.7 and the mentioned packages, I was able to call arcpy with no problem.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 28 Dec 2012 15:41:43 GMT</pubDate>
    <dc:creator>JeremiahNieves</dc:creator>
    <dc:date>2012-12-28T15:41:43Z</dc:date>
    <item>
      <title>&amp;amp;quot;arcpy module does not exist&amp;amp;quot;</title>
      <link>https://community.esri.com/t5/python-questions/amp-amp-quot-arcpy-module-does-not-exist-amp-amp/m-p/439156#M34477</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Quick background of the hardware and software I'm using:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;OS: Windows 7 64-bit&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Arc Info 10.0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;IDE: Wingware Python IDE 4.1.3&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Python 2.6 (installed with ArcGIS) AND 2.7 are installed on my machine&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; I am compiling a script to create 3D lines connecting 3D point features based on a common field. These point features represent bus stops and ultimately I am creating a multi-modal transportation network model. The street level stops are called "real" and are in one file where as the elevated stops are referred to as "psuedo" and are grouped by the route number they are associated with (some service more than one route so there is overlap).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; My main problem right now is that when I am debugging my script, the debugger keeps on saying that the arcpy module does not exist. I checked in command line with assoc and ftype to make sure that all .py file were associated with 2.6 and not 2.7. I tried to append the arcpy path using the sys module (see script) and it still said that arcpy did not exist. I can go through my computer and see the arcpy folder so I know it is there. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Any ideas?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;import sys sys.path.append('C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy') import arcpy arcpy.env.workspace = "C:\\Users\\Admiral Ackbar\\Desktop\\442PythonTempWorkspace\\442PythonTempWorkspace.gdb"&amp;nbsp; PSRGList = arcpy.ListFeatureClasses("","","PSUEDO_STOPS_ROUTE_GROUPS") #Retrieve a list of all 2D Psudeo Stop feature classes internally&amp;nbsp; grouped by route they service in the feature dataset "PSUEDO_STOPS_ROUTE_GROUPS"&amp;nbsp; for PSRG in PSRGList:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #for every pseudo stop route group (PSRG) in the PSGR list &amp;nbsp;&amp;nbsp;&amp;nbsp; PSRGcounter = 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #PSRG counter that indicates the index of the PSRGList that is currently going through iteration &amp;nbsp;&amp;nbsp;&amp;nbsp; newPSRGname = PSRGlist[PSRGcounter] + "_3D"&amp;nbsp;&amp;nbsp;&amp;nbsp; #Get the name of the PSRG feature from the list and add '_3D' for the new name&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; PSRG3D = arcpy.FeatureTo3DByAttribute(PSRG, newPSRGname, "ELEVATION") # Make the feature 3D by using the field 'ELEVATION' for height &amp;nbsp;&amp;nbsp;&amp;nbsp; print "New 3d Feature" + newPSRGname +"created." &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; SC_list=[]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #Empty list for stopcodes that will be retrieved &amp;nbsp;&amp;nbsp;&amp;nbsp; srows = arcpy.SearchCursor(newPSRGname,"","","STOP_CODE","STOP_CODE_A") #Create a search cursor to retrieve all stop code values in the 3D PSRG and put the values in ascending order &amp;nbsp;&amp;nbsp;&amp;nbsp; for srow in srows:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #For each row in the cursor &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Stop_code = srow.STOP_CODE&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #Assign a variable for the value of the STOP_CODE field &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SC_list.append(Stop_code)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #Append that value to the SC_List &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; del srow, srows&amp;nbsp;&amp;nbsp;&amp;nbsp; #Delete the search cursor &amp;nbsp;&amp;nbsp;&amp;nbsp; print "New Stop Code List created from" + str(newPSRGname) +"." &amp;nbsp;&amp;nbsp;&amp;nbsp; SC_List =["x","y","z"] &amp;nbsp;&amp;nbsp;&amp;nbsp; SCcounter=1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #counter&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; query=""&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #Empty string for query&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; SC_length = len(SC_list)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #Get the length of the Stop Code list &amp;nbsp;&amp;nbsp;&amp;nbsp; while SCcounter &amp;lt;= SC_length:&amp;nbsp;&amp;nbsp; #while there are items in the list SC_List &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for SC in SC_List:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if SCcounter &amp;lt; SC_length:&amp;nbsp;&amp;nbsp;&amp;nbsp; #if the SC counter is less than the length of the list SC_List &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; query += "\"STOP_CODE\" == \'%s\' OR " %(SC) #Create the initial portion of the query &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SCcounter +=1 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; query += "\"STOP_CODE\" == \'%s\'" %(SC)&amp;nbsp; #add other values to the query as long as there are values in the list &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SCcounter +=1 &amp;nbsp;&amp;nbsp;&amp;nbsp; print "The query to be used in Select By Attribute is " + query + "." &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.MakeFeatureLayer_management("REALBUSSTOPS_3D","REALBUSSTOPS_3D_lyr") #Create a Feature Layer for Select by Attribute &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; routenumlist = [] #create blank list &amp;nbsp;&amp;nbsp;&amp;nbsp; routenumlist = PSRG.split(_) #Split the PSRG name at every occurrence of '_' &amp;nbsp;&amp;nbsp;&amp;nbsp; routenum = routenumlist[1]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #Get the route number from the list of words in the PSRG feature which resides at the index 1 for every standardized PSRG name &amp;nbsp;&amp;nbsp;&amp;nbsp; selectedRBS_nam3 = "REALBUSSTOPS_3D_" + routenum #Name of the selected Real Bus Stops (RBS) feature to be &amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.SelectByAttribute_management("REALBUSSTOPS_3D_lyr",NEW_SELECTION,query) #Select the corresponding REALBUSSTOP_3D records&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CopyFeatures_management("REALBUSSTOPS_3D_lyr", sleectedRBS_nam3) #Create a new feature of the selected RealBusstops_3D &amp;nbsp;&amp;nbsp;&amp;nbsp; print"New 3d Feature"+ selectedRBS_nam3 + "was created." &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Delete_management("REALBUSSTOPS_3D_lyr") #Delete the layer&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; mergeoutput = "PSUEDO_REAL_3D_STOPS_" + routenum&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #Assign variable for the name of the output merge file &amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Merge_management([newPSRGname, selectedRBS_nam3], mergeoutput) #Merge the RBS and the PBRG points into one file &amp;nbsp;&amp;nbsp;&amp;nbsp; print"Selected real bus stops and PSRG" + routenum + "were merged into the file " + mergeoutput +"." &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; outputconnector="Connector_" + routenum&amp;nbsp;&amp;nbsp;&amp;nbsp; #Assign variable for the output points to line file &amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.PointsToLine_management(mergeoutput, outputconnector, "STOP_CODE") #Create the 3D connectors for that route group &amp;nbsp;&amp;nbsp;&amp;nbsp; print outputconnector + "was created." &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; PSRGcounter=+1 #Increase the PSRG counter by one for naming conventions to be correct on the next iteration &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; connectorlist = arcpy.ListFeatureClasses("",Polyline,"")&amp;nbsp;&amp;nbsp;&amp;nbsp; #Creates a list of the connector features classes in the workspace (connectors are the only polyline features in the workspace). connectorstring = "" connectorcounter = 0 while connect in connectorlist:&amp;nbsp;&amp;nbsp;&amp;nbsp; #while there are items in the list connectorlist &amp;nbsp;&amp;nbsp;&amp;nbsp; if connectorcounter &amp;lt;24: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; connectorstring+= connect+";"&amp;nbsp;&amp;nbsp; #append the string from connector list to the string connector string &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; connectorcounter+=1&amp;nbsp;&amp;nbsp;&amp;nbsp; #Add one to the counter &amp;nbsp;&amp;nbsp;&amp;nbsp; else: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; connectorstring=+ connect&amp;nbsp;&amp;nbsp; #Append the string from connector list with no trailing semicolon &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; connectorcounter+=1&amp;nbsp;&amp;nbsp;&amp;nbsp; #Add one to the counter &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Merge_management(connectorstring, "MASTER_CONNECTORS_3D") #Merge all of the connectors into one 'Master' 3D feature&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Dec 2012 23:13:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/amp-amp-quot-arcpy-module-does-not-exist-amp-amp/m-p/439156#M34477</guid>
      <dc:creator>JeremiahNieves</dc:creator>
      <dc:date>2012-12-27T23:13:32Z</dc:date>
    </item>
    <item>
      <title>Re: "arcpy module does not exist"</title>
      <link>https://community.esri.com/t5/python-questions/amp-amp-quot-arcpy-module-does-not-exist-amp-amp/m-p/439157#M34478</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;A source outside the forum, a Mr. Callahan, assisted me with this problem. It turns out that Python 2.7 and the 2.7 Numpy and Scipy packages I had installed as well were interfering with the call to arcpy for some reason. Once I uninstalled Python 2.7 and the mentioned packages, I was able to call arcpy with no problem.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Dec 2012 15:41:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/amp-amp-quot-arcpy-module-does-not-exist-amp-amp/m-p/439157#M34478</guid>
      <dc:creator>JeremiahNieves</dc:creator>
      <dc:date>2012-12-28T15:41:43Z</dc:date>
    </item>
  </channel>
</rss>

