<?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: Module object reading error attribute in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/module-object-reading-error-attribute/m-p/1247009#M66500</link>
    <description>&lt;P&gt;also what are functions of these parameters?&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;in_network, in_event, out_feature, {in_tvd}, {in_from_measure}, {in_to_measure}, {in_tolerance}&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 10 Jan 2023 20:40:29 GMT</pubDate>
    <dc:creator>JasonMa</dc:creator>
    <dc:date>2023-01-10T20:40:29Z</dc:date>
    <item>
      <title>Module object reading error attribute</title>
      <link>https://community.esri.com/t5/python-questions/module-object-reading-error-attribute/m-p/1246934#M66493</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;"""
Tesing the detect Gaps
"""
#import arcpy module
import arcpy

#Chcek out any necessary to licnes
arcpy.CheckOutExtension("Calgary1_done")

#local variables set
setNetwork = r"G:\Jason Ma\2022Q3 HERE shapefiles\Corridors\Old corridors\Calgary1_done"
#event =
final_gaps_output= r"G:\Jason Ma\2022Q3 HERE shapefiles\Corridors\Old corridors\New_Gaps_Cal1"



#Detect the GAPS in the linear events
arcpy.env.overwriteOutput = 1 
arcpy.DetectGapsForLinearEvents_locref(setNetwork, final_gaps_output)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hello all staff of Esri,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to create a function which detect gaps within road layer, seems that the library from Arcpy is not reading the module correctly in of the arcpy functions:&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error:&amp;nbsp;&lt;/P&gt;&lt;P&gt;Runtime error&lt;BR /&gt;Traceback (most recent call last):&lt;BR /&gt;File "&amp;lt;string&amp;gt;", line 18, in &amp;lt;module&amp;gt;&lt;BR /&gt;AttributeError: 'module' object has no attribute 'DetectGapsForLinearEvents_locref'&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggests and Help I glad to hear , Thanks you&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jan 2023 18:22:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/module-object-reading-error-attribute/m-p/1246934#M66493</guid>
      <dc:creator>JasonMa</dc:creator>
      <dc:date>2023-01-10T18:22:48Z</dc:date>
    </item>
    <item>
      <title>Re: Module object reading error attribute</title>
      <link>https://community.esri.com/t5/python-questions/module-object-reading-error-attribute/m-p/1246954#M66494</link>
      <description>&lt;P&gt;This is not available in Pro / Py 3.0.&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/appendices/unavailable-tools.htm" target="_self"&gt;unavailable-tools&lt;/A&gt;&amp;nbsp; - Location Referecing Tools section&lt;/P&gt;&lt;P&gt;You'll have to use the arcpy 2.7 version if you want to use that method DetectGapsForLinearEvents_locref&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jan 2023 19:27:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/module-object-reading-error-attribute/m-p/1246954#M66494</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2023-01-10T19:27:45Z</dc:date>
    </item>
    <item>
      <title>Re: Module object reading error attribute</title>
      <link>https://community.esri.com/t5/python-questions/module-object-reading-error-attribute/m-p/1246957#M66495</link>
      <description>&lt;P&gt;Hey&amp;nbsp;@Anonymous User&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the reply, Yes I believe I understand the version difference, I did run the script in the 3.8 version, but the ArcMAP desktop I have is build-in fixed as 2.7, do the method&amp;nbsp;DetectGapsForLinearEvents_locref should have recognized from the library, but I do not why arcpy is not reading the method and/or not found. Is there something I am missing? From the Code above?&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jan 2023 19:35:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/module-object-reading-error-attribute/m-p/1246957#M66495</guid>
      <dc:creator>JasonMa</dc:creator>
      <dc:date>2023-01-10T19:35:14Z</dc:date>
    </item>
    <item>
      <title>Re: Module object reading error attribute</title>
      <link>https://community.esri.com/t5/python-questions/module-object-reading-error-attribute/m-p/1246968#M66496</link>
      <description>&lt;P&gt;That is expected because arcpy modules are independent per python version and python environment.&lt;/P&gt;&lt;P&gt;Since you ran it in 3.8, it is looking at the 3.8 arcpy module within the 3.8 environment and it doesn't reach out to 2.7.&lt;/P&gt;&lt;P&gt;You have to point your IDE to which python version you want the script to execute in, so it would be using the C:\Python27\ArcGIS10.x\python.exe and 2.7 arcpy module, where the DetectGapsForLinearEvents_locref is.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jan 2023 19:48:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/module-object-reading-error-attribute/m-p/1246968#M66496</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2023-01-10T19:48:22Z</dc:date>
    </item>
    <item>
      <title>Re: Module object reading error attribute</title>
      <link>https://community.esri.com/t5/python-questions/module-object-reading-error-attribute/m-p/1246975#M66497</link>
      <description>&lt;P&gt;Hello&amp;nbsp;@Anonymous User&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Thank for the reply, I will see if IDE script which I can run maybe using 2.7 script rather than the 3.8 script environment. My question is I am running the above script directly in the ArcMap python build-in which is fixed 2.7 version , but I used version , I didnt run it in 3.8 IDE since there are no arcpy build into it. If you understand what I mean ? OR if there is something I am missing , please let me know&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again for the help and comments&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jan 2023 20:00:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/module-object-reading-error-attribute/m-p/1246975#M66497</guid>
      <dc:creator>JasonMa</dc:creator>
      <dc:date>2023-01-10T20:00:45Z</dc:date>
    </item>
    <item>
      <title>Re: Module object reading error attribute</title>
      <link>https://community.esri.com/t5/python-questions/module-object-reading-error-attribute/m-p/1246999#M66498</link>
      <description>&lt;P&gt;Not sure if I follow that, are you running it in Pro, or ArcMap?&lt;/P&gt;&lt;P&gt;If you are in 2.7, the docs show that you need the 'Roads and Highways' extension (not Calgary1_done- which looks like it is something else) and you are missing a required parameter at the event argument. Your out_feature is in the in_event slot:&lt;/P&gt;&lt;PRE&gt;arcpy.locref.DetectGapsForLinearEvents(in_network, in_event, out_feature, {in_tvd}, {in_from_measure}, {in_to_measure}, {in_tolerance})&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jan 2023 20:28:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/module-object-reading-error-attribute/m-p/1246999#M66498</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2023-01-10T20:28:12Z</dc:date>
    </item>
    <item>
      <title>Re: Module object reading error attribute</title>
      <link>https://community.esri.com/t5/python-questions/module-object-reading-error-attribute/m-p/1247005#M66499</link>
      <description>&lt;P&gt;Hey&amp;nbsp;@Anonymous User&amp;nbsp;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; I am running ArcMap 10.8 and built in python version 2.7 , Calgary1_done is just a city work I m trying correct urban areas. I want to see if I can make a Gap script to indenified missing data and gaps within these city. I need these parameters possible to make it work ? I thought I needed a local variable where&amp;nbsp; need set to my folder thats all'&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jan 2023 20:37:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/module-object-reading-error-attribute/m-p/1247005#M66499</guid>
      <dc:creator>JasonMa</dc:creator>
      <dc:date>2023-01-10T20:37:20Z</dc:date>
    </item>
    <item>
      <title>Re: Module object reading error attribute</title>
      <link>https://community.esri.com/t5/python-questions/module-object-reading-error-attribute/m-p/1247009#M66500</link>
      <description>&lt;P&gt;also what are functions of these parameters?&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;in_network, in_event, out_feature, {in_tvd}, {in_from_measure}, {in_to_measure}, {in_tolerance}&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jan 2023 20:40:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/module-object-reading-error-attribute/m-p/1247009#M66500</guid>
      <dc:creator>JasonMa</dc:creator>
      <dc:date>2023-01-10T20:40:29Z</dc:date>
    </item>
    <item>
      <title>Re: Module object reading error attribute</title>
      <link>https://community.esri.com/t5/python-questions/module-object-reading-error-attribute/m-p/1247498#M66516</link>
      <description>&lt;P&gt;Check out the docs for the explanation of those arguments:&lt;/P&gt;&lt;P&gt;&lt;A href="https://desktop.arcgis.com/en/arcmap/10.3/tools/roads-and-highways-toolbox/detect-gaps-for-linear-events.htm" target="_blank" rel="noopener"&gt;roads-and-highways-toolbox/detect-gaps-for-linear-events&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2023 23:10:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/module-object-reading-error-attribute/m-p/1247498#M66516</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2023-01-11T23:10:06Z</dc:date>
    </item>
    <item>
      <title>Re: Module object reading error attribute</title>
      <link>https://community.esri.com/t5/python-questions/module-object-reading-error-attribute/m-p/1248107#M66537</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;@Anonymous User&amp;nbsp;for the post,my apologies for intrusion, I put on the arguments and other parameters where necessary according to your instructions and I not&amp;nbsp; why python 2.7 shell was not able to read library locref as you wrote , I received this error :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&lt;STRONG&gt; &amp;nbsp; &amp;nbsp;Traceback (most recent call last):&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;File "G:\Jason Ma\Python scripts\CCTD\GapDetect.py", line 7, in &amp;lt;module&amp;gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;from locref import DetectGapsForLinearEvents&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;ImportError: No module named locref&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;"""
Tesing the detect Gaps
"""
#import arcpy module
import arcpy
from arcpy import env
#from locref import DetectGapsForLinearEvents 

#Chcek out any necessary to licnes
arcpy.CheckOutExtension("Calgary1_done")

#local variables set
setNetwork = r"G:\Jason Ma\2022Q3 HERE shapefiles\Corridors\Old corridors\Calgary1_done"
#event =
final_gaps_output= r"G:\Jason Ma\2022Q3 HERE shapefiles\Corridors\Old corridors\New_Gaps_Cal1"



#Detect the GAPS in the linear events
arcpy.env.overwriteOutput = 1 
arcpy.DetectGapsForLinearEvents_roads(in_network,in_event,out_feature,{in_tvd},{in_from_measure},{in_to_measure},{in_tolerance},setNetwork, final_gaps_output)&lt;/LI-CODE&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous User&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;Check out the docs for the explanation of those arguments:&lt;/P&gt;&lt;P&gt;&lt;A href="https://desktop.arcgis.com/en/arcmap/10.3/tools/roads-and-highways-toolbox/detect-gaps-for-linear-events.htm" target="_blank" rel="noopener"&gt;roads-and-highways-toolbox/detect-gaps-for-linear-events&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2023 16:36:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/module-object-reading-error-attribute/m-p/1248107#M66537</guid>
      <dc:creator>JasonMa</dc:creator>
      <dc:date>2023-01-13T16:36:57Z</dc:date>
    </item>
    <item>
      <title>Re: Module object reading error attribute</title>
      <link>https://community.esri.com/t5/python-questions/module-object-reading-error-attribute/m-p/1248137#M66541</link>
      <description>&lt;P&gt;The CheckoutExtension() is for authorizing extension licenses. Check out the documentation &lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/functions/checkoutextension.htm" target="_blank" rel="noopener"&gt;here&lt;/A&gt;&lt;/P&gt;&lt;P&gt;"Calgary_done" is not an extension listed in the docs.&lt;/P&gt;&lt;P&gt;Note that items in {} are optional parameters and {} should not be included in your code if you have variables to pass in to the function.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;arcpy.DetectGapsForLinearEvents_roads(in_network,in_event,out_feature,{in_tvd},{in_from_measure},{in_to_measure},{in_tolerance},setNetwork, final_gaps_output)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You need to assign your variables to the corresponding arguments position in the ().&lt;/P&gt;&lt;LI-CODE lang="python"&gt;#local variables set
setNetwork = r"G:\Jason Ma\2022Q3 HERE shapefiles\Corridors\Old corridors\Calgary1_done"
#event =
final_gaps_output= r"G:\Jason Ma\2022Q3 HERE shapefiles\Corridors\Old corridors\New_Gaps_Cal1"

arcpy.DetectGapsForLinearEvents_roads(setNetwork, in_event, final_gaps_output)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;You are missing the required in_event parameter-&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2023 17:50:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/module-object-reading-error-attribute/m-p/1248137#M66541</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2023-01-13T17:50:37Z</dc:date>
    </item>
  </channel>
</rss>

