<?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 Can't import arcpy within Flask in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/can-t-import-arcpy-within-flask/m-p/513702#M40328</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I set up FastCGI in IIS and got the HelloWorld.py working properly. I also cloned conda env with Python-Package-Manager inside ArcGIS Pro for installing further 3rd party packages like pyodbc, etc. Inside my Flask.app I can't import arcpy, though all necessary paths are listed in sys.path. Everything I get is 500 Internal Server Error, nothing else.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think I have to activate the conda environment, right?&lt;/P&gt;&lt;P&gt;I can successfully import arcpy within a standalone script and run it in VS Code Terminal. There, it seems to activate the conda environment BEFORE running the script. I see &amp;lt;PYTHONPATH&amp;gt;/activate.bat in the Terminal. It also works per cmd. So my question is, how do I activate the conda env before running the flask script?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there another way to use arcpy from arcgis pro with flask?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help is appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Andre&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 07 Oct 2020 13:25:02 GMT</pubDate>
    <dc:creator>AndreV</dc:creator>
    <dc:date>2020-10-07T13:25:02Z</dc:date>
    <item>
      <title>Can't import arcpy within Flask</title>
      <link>https://community.esri.com/t5/python-questions/can-t-import-arcpy-within-flask/m-p/513702#M40328</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I set up FastCGI in IIS and got the HelloWorld.py working properly. I also cloned conda env with Python-Package-Manager inside ArcGIS Pro for installing further 3rd party packages like pyodbc, etc. Inside my Flask.app I can't import arcpy, though all necessary paths are listed in sys.path. Everything I get is 500 Internal Server Error, nothing else.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think I have to activate the conda environment, right?&lt;/P&gt;&lt;P&gt;I can successfully import arcpy within a standalone script and run it in VS Code Terminal. There, it seems to activate the conda environment BEFORE running the script. I see &amp;lt;PYTHONPATH&amp;gt;/activate.bat in the Terminal. It also works per cmd. So my question is, how do I activate the conda env before running the flask script?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there another way to use arcpy from arcgis pro with flask?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help is appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Andre&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Oct 2020 13:25:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/can-t-import-arcpy-within-flask/m-p/513702#M40328</guid>
      <dc:creator>AndreV</dc:creator>
      <dc:date>2020-10-07T13:25:02Z</dc:date>
    </item>
    <item>
      <title>Re: Can't import arcpy within Flask</title>
      <link>https://community.esri.com/t5/python-questions/can-t-import-arcpy-within-flask/m-p/513703#M40329</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Solved the problem with the help of this post &lt;A _jive_internal="true" class="link-titled" href="https://community.esri.com/thread/260581-are-wfastcgi-python-api-compatible#comment-956114" title="https://community.esri.com/thread/260581-are-wfastcgi-python-api-compatible#comment-956114"&gt;https://community.esri.com/thread/260581-are-wfastcgi-python-api-compatible#comment-956114&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Problem was with NTFS-Permissions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Oct 2020 10:44:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/can-t-import-arcpy-within-flask/m-p/513703#M40329</guid>
      <dc:creator>AndreV</dc:creator>
      <dc:date>2020-10-19T10:44:23Z</dc:date>
    </item>
  </channel>
</rss>

