AnsweredAssumed Answered

Are wFastCGI & Python API compatible?

Question asked by jasonwise on Sep 28, 2020
Latest reply on Sep 29, 2020 by jasonwise

I'm trying to write a web service that gets data from ArcGIS Portal, even though that might seem redundant. I'm using IIS, wFastCGI, Flask, and the ArcGIS API for Python. The service runs fine on localhost using Flask's web server, but it fails when I run it with IIS and wFastCGI. When I import arcgis, it imports ipywidgets, which imports IPython. IPython tries to do something with the input stream (stdin), but wFastCGI has already hijacked the input stream for its own purposes. Here's how it ends:

 

...\lib\site-packages\IPython\utils\io.py", line 81, in closed
  return self.stream.closed
ValueError: underlying buffer has been detached


In other words, wFastCGI appears to be incompatible with IPython, which makes wFastCGI incompatible with the ArcGIS API for Python. One of the frustrating things about this is that I don't need IPython, but I can't avoid importing it.

 

Apparently at least one person has gotten something similar to work. Is it possible for wFastCGI and the Python API to coexist?

Outcomes