<?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 Unable to import arcpy into MATLAB in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/unable-to-import-arcpy-into-matlab/m-p/1410795#M70351</link>
    <description>&lt;DIV class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;Using MATLAB 2023b, trying to run Python commands, mainly ArcGIS Pro related stuff via arcpy library. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;pyenv&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt; is set to use the correct Python installation (the one containing arcpy). &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;Arcpy works fine on my computer. Also tried restarting both the computer and ArcGIS Pro. Even reinstalled&amp;nbsp;ArcGIS Pro. Made an arcpy clone, unsuccessfully tried to update all packages it contains (via Package manager in ArcGIS Pro options menu). I get the same problem for both original arcpy and the clone.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;It crashes while importing it. This is weird because I can import and use math library, which is installed in the Python intepreter by default. I use "&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;a = py.importlib.import_module(&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;'arcpy'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;);&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;" to import it.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;The error I get:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BLOCKQUOTE&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;Python Error: ImportError: DLL load failed while importing _arcgisscripting: &amp;lt;'listed procedure not found' - kind of message in my system´s language&amp;gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&lt;DIV class=""&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="kradijaf_0-1713350143930.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/101190i9042BB17464C6DC0/image-size/large?v=v2&amp;amp;px=999" role="button" title="kradijaf_0-1713350143930.png" alt="kradijaf_0-1713350143930.png" /&gt;&lt;/span&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;Arcpy in Python works fine while I´m unable to import it into MATLAB. Posting the question here because it´s&amp;nbsp;related to Python/arcPY. Asked &lt;A href="https://www.mathworks.com/matlabcentral/answers/2107766-unable-to-import-arcpy-into-matlab?s_tid=prof_contriblnk" target="_self"&gt;the same question&lt;/A&gt;&amp;nbsp;in MATLAB forum, got no answer yet. Think it makes more sense to ask it here because everything related to my MATLAB installation and Python compatibility seems fine. The import error seems to be more arcpy related.&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;Will be grateful for any help!&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;*UPDATE*&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;1) Adding arcpy-Python interpreter into PATH as suggested &lt;A href="https://www.partitionwizard.com/partitionmanager/the-specified-module-could-not-be-found.html" target="_self"&gt;here&lt;/A&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp;didn´t help.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;2) Tested importing arcpy into MATLAB on different PC, setting&amp;nbsp;&lt;EM&gt;pyenv&lt;/EM&gt; to&amp;nbsp;arcpy interpreter worked, so did working with other libraries installed in it (e. g.&amp;nbsp;&lt;EM&gt;math&lt;/EM&gt;, mentioned in 2st paragraph). Got exactly the same error.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;</description>
    <pubDate>Wed, 17 Apr 2024 10:39:38 GMT</pubDate>
    <dc:creator>kradijaf</dc:creator>
    <dc:date>2024-04-17T10:39:38Z</dc:date>
    <item>
      <title>Unable to import arcpy into MATLAB</title>
      <link>https://community.esri.com/t5/python-questions/unable-to-import-arcpy-into-matlab/m-p/1410795#M70351</link>
      <description>&lt;DIV class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;Using MATLAB 2023b, trying to run Python commands, mainly ArcGIS Pro related stuff via arcpy library. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;pyenv&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt; is set to use the correct Python installation (the one containing arcpy). &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;Arcpy works fine on my computer. Also tried restarting both the computer and ArcGIS Pro. Even reinstalled&amp;nbsp;ArcGIS Pro. Made an arcpy clone, unsuccessfully tried to update all packages it contains (via Package manager in ArcGIS Pro options menu). I get the same problem for both original arcpy and the clone.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;It crashes while importing it. This is weird because I can import and use math library, which is installed in the Python intepreter by default. I use "&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;a = py.importlib.import_module(&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;'arcpy'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;);&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;" to import it.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;The error I get:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BLOCKQUOTE&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;Python Error: ImportError: DLL load failed while importing _arcgisscripting: &amp;lt;'listed procedure not found' - kind of message in my system´s language&amp;gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&lt;DIV class=""&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="kradijaf_0-1713350143930.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/101190i9042BB17464C6DC0/image-size/large?v=v2&amp;amp;px=999" role="button" title="kradijaf_0-1713350143930.png" alt="kradijaf_0-1713350143930.png" /&gt;&lt;/span&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;Arcpy in Python works fine while I´m unable to import it into MATLAB. Posting the question here because it´s&amp;nbsp;related to Python/arcPY. Asked &lt;A href="https://www.mathworks.com/matlabcentral/answers/2107766-unable-to-import-arcpy-into-matlab?s_tid=prof_contriblnk" target="_self"&gt;the same question&lt;/A&gt;&amp;nbsp;in MATLAB forum, got no answer yet. Think it makes more sense to ask it here because everything related to my MATLAB installation and Python compatibility seems fine. The import error seems to be more arcpy related.&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;Will be grateful for any help!&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;*UPDATE*&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;1) Adding arcpy-Python interpreter into PATH as suggested &lt;A href="https://www.partitionwizard.com/partitionmanager/the-specified-module-could-not-be-found.html" target="_self"&gt;here&lt;/A&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp;didn´t help.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;2) Tested importing arcpy into MATLAB on different PC, setting&amp;nbsp;&lt;EM&gt;pyenv&lt;/EM&gt; to&amp;nbsp;arcpy interpreter worked, so did working with other libraries installed in it (e. g.&amp;nbsp;&lt;EM&gt;math&lt;/EM&gt;, mentioned in 2st paragraph). Got exactly the same error.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 17 Apr 2024 10:39:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/unable-to-import-arcpy-into-matlab/m-p/1410795#M70351</guid>
      <dc:creator>kradijaf</dc:creator>
      <dc:date>2024-04-17T10:39:38Z</dc:date>
    </item>
  </channel>
</rss>

