<?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: Problem when using python/arcpy script in FME in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/problem-when-using-python-arcpy-script-in-fme/m-p/134407#M10539</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hy Bruce,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry for the late response, I had to interrupt my project for another.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your sample toolbox. Like this I discovered DataInteroperability extension.&lt;/P&gt;&lt;P&gt;But that does not solve my problem, you does not call arcpy library in PythonCaller component.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="PythonCaller" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/359751_Capture.JPG" style="width: 620px; height: 205px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I used &lt;STRONG&gt;SystemCaller instead of PythonCaller&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;Methodology is different, but it also acceptable for my project.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks again,&lt;/P&gt;&lt;P&gt;Flavie&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 01 Jul 2017 07:21:06 GMT</pubDate>
    <dc:creator>FlavieMORAUX1</dc:creator>
    <dc:date>2017-07-01T07:21:06Z</dc:date>
    <item>
      <title>Problem when using python/arcpy script in FME</title>
      <link>https://community.esri.com/t5/python-questions/problem-when-using-python-arcpy-script-in-fme/m-p/134403#M10535</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #212121; background-color: #ffffff; font-size: 16px;"&gt;Hy,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #212121; background-color: #ffffff; font-size: 16px;"&gt;I&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #212121; background-color: #ffffff; font-size: 16px;"&gt;encounter a problem when using a python / arcpy script in FME, from a PythonCaller.&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="color: #212121; background-color: #ffffff; font-size: 16px;"&gt;Some arcpy instruction does not work in FME,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #212121; background-color: #ffffff; font-size: 16px;"&gt;for example :&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG style="background-color: #ffffff; color: #212121; font-size: 16px;"&gt;arcpy.Exists ==&amp;gt;&amp;nbsp;return feature class does not exist ;&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG style="background-color: #ffffff; color: #212121; font-size: 16px;"&gt;arcpy.CopyFeatures_management ==&amp;gt;&amp;nbsp;fails with following&amp;nbsp;explanation&amp;nbsp;feature class does not exist.&lt;/STRONG&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #212121; background-color: #ffffff; font-size: 16px;"&gt;However, in ArcGIS Desktop it works (feature class exist) :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Arcpy in ArcGIS Desktop works." class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/345255_ArcpyInAGD.png" style="width: 620px; height: 49px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, in python it works &lt;SPAN style="color: #212121; background-color: #ffffff;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #212121; background-color: #ffffff;"&gt;feature class&lt;/SPAN&gt;&lt;SPAN style="color: #212121; background-color: #ffffff;"&gt; exist)&amp;nbsp;&lt;/SPAN&gt;:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Arcpy in Python." class="image-2 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/345256_ArcpyInPython.png" style="width: 620px; height: 175px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the code contained in FME :&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P style="margin: 0cm 0cm 0.0001pt 5pt; font-size: 11pt; color: #000000; text-indent: -5pt;"&gt;&lt;SPAN style="font-size: 12pt; color: black;"&gt;# Import system library&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0.0001pt 5pt; font-size: 11pt; color: #000000; text-indent: -5pt;"&gt;&lt;EM style="color: black; font-size: 12pt;"&gt;import sys&lt;/EM&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0.0001pt 5pt; font-size: 11pt; color: #000000; text-indent: -5pt;"&gt;&lt;EM style="color: black; font-size: 12pt;"&gt;reload(sys)&lt;/EM&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0.0001pt 5pt; font-size: 11pt; color: #000000; text-indent: -5pt;"&gt;&lt;EM style="color: black; font-size: 12pt;"&gt;sys.setdefaultencoding('utf-8')&lt;/EM&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0.0001pt 5pt; font-size: 11pt; color: #000000; text-indent: -5pt;"&gt;&lt;SPAN style="font-size: 12pt; color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0.0001pt 5pt; font-size: 11pt; color: #000000; text-indent: -5pt;"&gt;&lt;SPAN style="font-size: 12pt; color: black;"&gt;# Import arcpy librairy for FME&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0.0001pt 5pt; font-size: 11pt; color: #000000; text-indent: -5pt;"&gt;&lt;EM style="color: black; font-size: 12pt;"&gt;agdArcpyPath = r'C:\Program Files (x86)\ArcGIS\Desktop10.3\arcpy'&lt;/EM&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0.0001pt 5pt; font-size: 11pt; color: #000000; text-indent: -5pt;"&gt;&lt;EM style="color: black; font-size: 12pt;"&gt;agdBinPath=r'C:\Program Files (x86)\ArcGIS\Desktop10.3\bin'&lt;/EM&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0.0001pt 5pt; font-size: 11pt; color: #000000; text-indent: -5pt;"&gt;&lt;EM style="color: black; font-size: 12pt;"&gt;if agdBinPathnot in sys.path:&lt;/EM&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0.0001pt 5pt; font-size: 11pt; color: #000000; text-indent: -5pt;"&gt;&lt;EM style="color: black; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sys.path.append(agdBinPath)&lt;/EM&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0.0001pt 5pt; font-size: 11pt; color: #000000; text-indent: -5pt;"&gt;&lt;EM style="color: black; font-size: 12pt;"&gt;if agdArcpyPath not in sys.path:&lt;/EM&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0.0001pt 5pt; font-size: 11pt; color: #000000; text-indent: -5pt;"&gt;&lt;EM style="color: black; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sys.path.append(agdArcpyPath )&lt;/EM&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0.0001pt 5pt; font-size: 11pt; color: #000000; text-indent: -5pt;"&gt;&lt;EM style="color: black; font-size: 12pt;"&gt;import arcpy&lt;/EM&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0.0001pt 5pt; font-size: 11pt; color: #000000; text-indent: -5pt;"&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0.0001pt 5pt; font-size: 11pt; color: #000000; text-indent: -5pt;"&gt;&lt;SPAN style="font-size: 12pt; color: black;"&gt;# Workflow&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0.0001pt 5pt; font-size: 11pt; color: #000000; text-indent: -5pt;"&gt;&lt;EM style="color: black; font-size: 12pt;"&gt;fcPath=&amp;nbsp;r"\\infogeo.ressources.paris.mdp\Parametres\ADMIN_SDE_AGS\00_CONNEXIONS_PROPRIETAIRES\BOSSINTG\BOSS_Intg@DVD_PVP(GISOwner).sde\DVD_PVP.CELARB_POINT"&lt;/EM&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0.0001pt 5pt; font-size: 11pt; color: #000000; text-indent: -5pt;"&gt;&lt;EM style="color: #ff0000; font-size: 12pt;"&gt;if arcpy.Exists(fcPath): &lt;/EM&gt;&lt;SPAN style="font-size: 12pt; color: #ff0000;"&gt;&lt;STRONG&gt;# Problem, it return False in FME&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0.0001pt 5pt; font-size: 11pt; color: #000000; text-indent: -5pt;"&gt;&lt;SPAN style="color: #000000; text-indent: -6.66667px;"&gt;&amp;nbsp; &amp;nbsp;# Execute workflow&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0.0001pt 5pt; font-size: 11pt; color: #000000; text-indent: -5pt;"&gt;&lt;EM style="color: #000000; text-indent: -6.66667px;"&gt;&amp;nbsp; &amp;nbsp;pass&lt;/EM&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0.0001pt 5pt; font-size: 11pt; color: #000000; text-indent: -5pt;"&gt;&lt;EM style="color: #000000; text-indent: -6.66667px;"&gt;#end if&lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P style="margin: 0cm 0cm 0.0001pt 5pt; font-size: 11pt; color: #000000; text-indent: -5pt;"&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0.0001pt 5pt; font-size: 11pt; color: #000000; text-indent: -5pt;"&gt;&lt;SPAN style="color: #000000; text-indent: -6.66667px;"&gt;For information here is the technical background :&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI style="margin: 0cm 0cm 0.0001pt 5pt; font-size: 11pt; color: #000000; text-indent: -5pt;"&gt;&lt;SPAN style="color: #000000; text-indent: -6.66667px;"&gt;ArcGIS Desktop 10.3.1 French&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI style="margin: 0cm 0cm 0.0001pt 5pt; font-size: 11pt; color: #000000; text-indent: -5pt;"&gt;&lt;SPAN style="color: #000000; text-indent: -6.66667px;"&gt;FME 2016.1&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P style="margin: 0cm 0cm 0.0001pt 5pt; font-size: 11pt; color: #000000; text-indent: -5pt;"&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0.0001pt 5pt; font-size: 11pt; color: #000000; text-indent: -5pt;"&gt;&lt;STRONG style="color: #000000; text-indent: -6.66667px;"&gt;Has anyone ever succeeded in integrating some python/arcpy code into FME?&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0.0001pt 5pt; font-size: 11pt; color: #000000; text-indent: -5pt;"&gt;&lt;STRONG style="color: #000000; text-indent: -6.66667px;"&gt;Do you have an idea to solve my problem?&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0.0001pt 5pt; font-size: 11pt; color: #000000; text-indent: -5pt;"&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0.0001pt 5pt; font-size: 11pt; color: #000000; text-indent: -5pt;"&gt;&lt;SPAN style="color: #000000; text-indent: -6.66667px;"&gt;Thank you for your help.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0.0001pt 5pt; font-size: 11pt; color: #000000; text-indent: -5pt;"&gt;&lt;SPAN style="color: #000000; text-indent: -6.66667px;"&gt;Flavie&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Apr 2017 11:57:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/problem-when-using-python-arcpy-script-in-fme/m-p/134403#M10535</guid>
      <dc:creator>FlavieMORAUX1</dc:creator>
      <dc:date>2017-04-04T11:57:51Z</dc:date>
    </item>
    <item>
      <title>Re: Problem when using python/arcpy script in FME</title>
      <link>https://community.esri.com/t5/python-questions/problem-when-using-python-arcpy-script-in-fme/m-p/134404#M10536</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Bonjour Flavie&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It might be arcpy is not loading properly.&lt;/P&gt;&lt;P&gt;Please see how I call arcpy in this example:&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://www.arcgis.com/home/item.html?id=7e51a30ca0e54988b073e5d589e4441b" title="http://www.arcgis.com/home/item.html?id=7e51a30ca0e54988b073e5d589e4441b"&gt;http://www.arcgis.com/home/item.html?id=7e51a30ca0e54988b073e5d589e4441b&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Making a subprocess ensures the Python environments are clean.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Apr 2017 14:36:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/problem-when-using-python-arcpy-script-in-fme/m-p/134404#M10536</guid>
      <dc:creator>BruceHarold</dc:creator>
      <dc:date>2017-04-04T14:36:37Z</dc:date>
    </item>
    <item>
      <title>Re: Problem when using python/arcpy script in FME</title>
      <link>https://community.esri.com/t5/python-questions/problem-when-using-python-arcpy-script-in-fme/m-p/134405#M10537</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hy Bruce,&lt;/P&gt;&lt;P&gt;Small problem...&amp;nbsp;ZIP file contains only toolbox (no python file) and in ArcMAP (10.2.2) toolbox appears as empty.&lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/sad.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="ShutdownScript" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/345308_Capture.PNG" style="height: auto;" /&gt;&lt;BR /&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Flavie&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Apr 2017 16:17:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/problem-when-using-python-arcpy-script-in-fme/m-p/134405#M10537</guid>
      <dc:creator>FlavieMORAUX1</dc:creator>
      <dc:date>2017-04-04T16:17:50Z</dc:date>
    </item>
    <item>
      <title>Re: Problem when using python/arcpy script in FME</title>
      <link>https://community.esri.com/t5/python-questions/problem-when-using-python-arcpy-script-in-fme/m-p/134406#M10538</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Flavie&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need Data Interoperability extension installed and enabled, then you will see a Spatial ETL tool, in the advanced parameters is a Python shutdown script.&amp;nbsp; My apologies for not explaining, it was an early start :-).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Apr 2017 16:19:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/problem-when-using-python-arcpy-script-in-fme/m-p/134406#M10538</guid>
      <dc:creator>BruceHarold</dc:creator>
      <dc:date>2017-04-04T16:19:58Z</dc:date>
    </item>
    <item>
      <title>Re: Problem when using python/arcpy script in FME</title>
      <link>https://community.esri.com/t5/python-questions/problem-when-using-python-arcpy-script-in-fme/m-p/134407#M10539</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hy Bruce,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry for the late response, I had to interrupt my project for another.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your sample toolbox. Like this I discovered DataInteroperability extension.&lt;/P&gt;&lt;P&gt;But that does not solve my problem, you does not call arcpy library in PythonCaller component.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="PythonCaller" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/359751_Capture.JPG" style="width: 620px; height: 205px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I used &lt;STRONG&gt;SystemCaller instead of PythonCaller&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;Methodology is different, but it also acceptable for my project.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks again,&lt;/P&gt;&lt;P&gt;Flavie&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 01 Jul 2017 07:21:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/problem-when-using-python-arcpy-script-in-fme/m-p/134407#M10539</guid>
      <dc:creator>FlavieMORAUX1</dc:creator>
      <dc:date>2017-07-01T07:21:06Z</dc:date>
    </item>
  </channel>
</rss>

