<?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: Import Toolbox Syntax Error in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/import-toolbox-syntax-error/m-p/1542770#M72941</link>
    <description>&lt;P&gt;So after stumbling across an old Google Groups discussion for LAStools, it turns out that this issue is specific to LAStools. My successful workaround was to use OS to run LAStools as a command like this:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import os

lidar_shp = r"C:\file_path\lidar.shp"
las_result = r"C:\file_path\lidar.las"
las_com = fr"C:\LAStools\bin\shp2las.exe -i {lidar_shp} -o {las_result}"
os.system(las_com)&lt;/LI-CODE&gt;</description>
    <pubDate>Wed, 25 Sep 2024 23:27:32 GMT</pubDate>
    <dc:creator>jacob_ekn</dc:creator>
    <dc:date>2024-09-25T23:27:32Z</dc:date>
    <item>
      <title>Import Toolbox Syntax Error</title>
      <link>https://community.esri.com/t5/python-questions/import-toolbox-syntax-error/m-p/1542741#M72939</link>
      <description>&lt;P&gt;I've seen some other past posts about syntax errors with Import Toolbox, but I'm not sure what's causing the issue for me.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;arcpy.ImportToolbox(r"C:\LAStools\ArcGIS_toolbox\LAStools.tbx")&lt;/LI-CODE&gt;&lt;P&gt;I've tried it with the alias parameter filled out too, made sure there's an alias in ArcGIS Pro, but keep getting the following syntax error:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;SyntaxError: expected '('&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;I honestly have no idea where an open parenthesis is supposed to go. Anyone know any fixes for this?&lt;/P&gt;</description>
      <pubDate>Wed, 25 Sep 2024 22:02:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/import-toolbox-syntax-error/m-p/1542741#M72939</guid>
      <dc:creator>jacob_ekn</dc:creator>
      <dc:date>2024-09-25T22:02:37Z</dc:date>
    </item>
    <item>
      <title>Re: Import Toolbox Syntax Error</title>
      <link>https://community.esri.com/t5/python-questions/import-toolbox-syntax-error/m-p/1542744#M72940</link>
      <description>&lt;P&gt;Here's the full error message:&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" color="#FF0000"&gt;LiDAR SHP to Contour&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" color="#FF0000"&gt;=====================&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" color="#FF0000"&gt;Parameters&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" color="#FF0000"&gt;LiDAR Shapefile G:\Projects\PGE\TowerStormDataResearch2024\LiDARtoTOPO\Data\Birds Landing SW STA-Contra Costa SUB\Birds Landing SW STA-Contra Costa SUB.shp&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" color="#FF0000"&gt;Final Output G:\Projects\PGE\TowerStormDataResearch2024\LiDARtoTOPO\BirdsLandingContraCosta_contour.shp&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" color="#FF0000"&gt;=====================&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" color="#FF0000"&gt;Messages&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" color="#FF0000"&gt;Start Time: Wednesday, September 25, 2024 2:49:17 PM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" color="#FF0000"&gt;Traceback (most recent call last):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" color="#FF0000"&gt;File "G:\Projects\PGE\TowerStormDataResearch2024\LiDARtoTOPO\LiDARtoTOPO.atbx\lidar2contour.tool\tool.script.execute.py", line 83, in &amp;lt;module&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" color="#FF0000"&gt;File "G:\Projects\PGE\TowerStormDataResearch2024\LiDARtoTOPO\LiDARtoTOPO.atbx\lidar2contour.tool\tool.script.execute.py", line 19, in lidar_process&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" color="#FF0000"&gt;File "G:\Projects\PGE\TowerStormDataResearch2024\LiDARtoTOPO\LiDARtoTOPO.atbx\lidar2contour.tool\tool.script.execute.py", line 68, in get_ps&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" color="#FF0000"&gt;File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\__init__.py", line 179, in ImportToolbox&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" color="#FF0000"&gt;return import_toolbox(input_file, module_name)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" color="#FF0000"&gt;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" color="#FF0000"&gt;File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\toolbox_code.py", line 548, in import_toolbox&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" color="#FF0000"&gt;mymodule = generate_toolbox_module(toolbox, None, False, False, False, module_name, use_alt_alias)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" color="#FF0000"&gt;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" color="#FF0000"&gt;File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\toolbox_code.py", line 522, in generate_toolbox_module&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" color="#FF0000"&gt;mycode = compile(code, toolbox.pathName, 'exec')&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" color="#FF0000"&gt;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" color="#FF0000"&gt;File "C:\LAStools\ArcGIS_toolbox\LAStools.tbx", line 1142&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" color="#FF0000"&gt;^&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" color="#FF0000"&gt;SyntaxError: expected '('&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" color="#FF0000"&gt;Failed script LiDAR SHP to Contour...&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" color="#FF0000"&gt;Failed to execute (lidar2contour).&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" color="#FF0000"&gt;Failed at Wednesday, September 25, 2024 2:54:16 PM (Elapsed Time: 4 minutes 58 seconds)&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Sep 2024 22:05:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/import-toolbox-syntax-error/m-p/1542744#M72940</guid>
      <dc:creator>jacob_ekn</dc:creator>
      <dc:date>2024-09-25T22:05:51Z</dc:date>
    </item>
    <item>
      <title>Re: Import Toolbox Syntax Error</title>
      <link>https://community.esri.com/t5/python-questions/import-toolbox-syntax-error/m-p/1542770#M72941</link>
      <description>&lt;P&gt;So after stumbling across an old Google Groups discussion for LAStools, it turns out that this issue is specific to LAStools. My successful workaround was to use OS to run LAStools as a command like this:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import os

lidar_shp = r"C:\file_path\lidar.shp"
las_result = r"C:\file_path\lidar.las"
las_com = fr"C:\LAStools\bin\shp2las.exe -i {lidar_shp} -o {las_result}"
os.system(las_com)&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 25 Sep 2024 23:27:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/import-toolbox-syntax-error/m-p/1542770#M72941</guid>
      <dc:creator>jacob_ekn</dc:creator>
      <dc:date>2024-09-25T23:27:32Z</dc:date>
    </item>
  </channel>
</rss>

