Can't import arcpy within Flask

10-07-2020 06:25 AM
New Contributor III


I set up FastCGI in IIS and got the 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 I can't import arcpy, though all necessary paths are listed in sys.path. Everything I get is 500 Internal Server Error, nothing else.

I think I have to activate the conda environment, right?

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 <PYTHONPATH>/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?

Is there another way to use arcpy from arcgis pro with flask?

Any help is appreciated.

0 Kudos
1 Reply
New Contributor III

Solved the problem with the help of this post

Problem was with NTFS-Permissions.
0 Kudos