# Flask, Windows, IIS, Plotly-Dash. Error Occured While reading WSGI handler

**URL:** <https://community.plotly.com/t/flask-windows-iis-plotly-dash-error-occured-while-reading-wsgi-handler/9911>\
**Category:** Dash Python\
**Created:** [April 25, 2018, 1:05pm UTC](https://community.plotly.com/t/flask-windows-iis-plotly-dash-error-occured-while-reading-wsgi-handler/9911 "2018-04-25T13:05:46Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![roastbeeef](https://avatars.discourse-cdn.com/v4/letter/r/6a8cbe/32.png) [@roastbeeef](https://community.plotly.com/u/roastbeeef)\
**Post date:** [April 25, 2018, 1:05pm UTC](https://community.plotly.com/t/flask-windows-iis-plotly-dash-error-occured-while-reading-wsgi-handler/9911/1 "2018-04-25T13:05:46Z")

</div>

I’m hoping you can help me with errors that I’m getting with Flask in an attempt to deploy plotly-dash on a Windows server.

I’ve set up Flask using the following guide, verbatim, except the location of my website within the wwwroot folder: [Flask on IIS](http://netdot.co/2015/03/09/flask-on-iis/)

My error isnt specifically with Dash, but I’m hoping that with the expertise available on this forum, you can probably help or at least point me in the right direction, as follows:

```
Error occurred while reading WSGI handler: 
Traceback (most recent call last): 
File "C:\inetpub\wwwroot\wfastcgi.py", line 791, in main env, handler = read_wsgi_handler(response.physical_path) 
File "C:\inetpub\wwwroot\wfastcgi.py", line 633, in read_wsgi_handler handler = get_wsgi_handler(os.getenv("WSGI_HANDLER")) 
File "C:\inetpub\wwwroot\wfastcgi.py", line 600, in get_wsgi_handler handler = __import__ (module_name, fromlist=[name_list[0][0]]) 
File ".\app.py", line 1, in import dash 
File "C:\Python36\lib\site-packages\dash\ __init__.py", line 1, in from .dash import Dash # noqa: F401 
File "C:\Python36\lib\site-packages\dash\dash.py", line 12, in import plotly 
File "C:\Python36\lib\site-packages\plotly\ __init__.py", line 31, in from plotly import (plotly, dashboard_objs, graph_objs, grid_objs, tools, 
File "C:\Python36\lib\site-packages\plotly\plotly\ __init__.py", line 10, in from . plotly import ( 
File "C:\Python36\lib\site-packages\plotly\plotly\plotly.py", line 30, in from plotly import exceptions, files, session, tools, utils 
File "C:\Python36\lib\site-packages\plotly\tools.py", line 59, in ipython_core_display = optional_imports.get_module('IPython.core.display') 
File "C:\Python36\lib\site-packages\plotly\optional_imports.py", line 23, in get_module return import_module(name) 
File "C:\Python36\lib\importlib\ __init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) 
File "C:\Python36\lib\site-packages\IPython\ __init__.py", line 55, in from .terminal.embed import embed 
File "C:\Python36\lib\site-packages\IPython\terminal\embed.py", line 15, in from IPython.core.interactiveshell import DummyMod, InteractiveShell 
File "C:\Python36\lib\site-packages\IPython\core\interactiveshell.py", line 61, in from IPython.utils import io 
File "C:\Python36\lib\site-packages\IPython\utils\io.py", line 95, in stdin = IOStream(sys.stdin, fallback=devnull) 
File "C:\Python36\lib\site-packages\IPython\utils\io.py", line 39, in __init__ for meth in filter(clone, dir(stream)): 
File "C:\Python36\lib\site-packages\IPython\utils\io.py", line 38, in clone return not hasattr(self, meth) and not meth.startswith('_') 
File "C:\Python36\lib\site-packages\IPython\utils\io.py", line 82, in closed return self.stream.closed 
ValueError: underlying buffer has been detached StdOut: StdErr:

```

I’ve been googling and tweaking my settings for hours and hours, any ideas?

Server is running Windows 2008 R2 with IIS 7.5

---

<div class="post-metadata">

**Author:** ![eddy\_oj](https://avatars.discourse-cdn.com/v4/letter/e/3ab097/32.png) [@eddy\_oj](https://community.plotly.com/u/eddy_oj)\
**Post date:** [April 30, 2018, 9:26pm UTC](https://community.plotly.com/t/flask-windows-iis-plotly-dash-error-occured-while-reading-wsgi-handler/9911/2 "2018-04-30T21:26:45Z")

</div>

Hi @roastbeeef,

Did you check out the following post?

[https://community.plotly.com/t/solved-deploy-dash-on-iis-error/5434/3](https://community.plotly.com/t/solved-deploy-dash-on-iis-error/5434/3)

Uninstallling ipython worked for me…

---

<div class="post-metadata">

**Author:** ![roastbeeef](https://avatars.discourse-cdn.com/v4/letter/r/6a8cbe/32.png) [@roastbeeef](https://community.plotly.com/u/roastbeeef)\
**Post date:** [May 1, 2018, 12:36pm UTC](https://community.plotly.com/t/flask-windows-iis-plotly-dash-error-occured-while-reading-wsgi-handler/9911/3 "2018-05-01T12:36:43Z")

</div>

Thats worked for me, thanks! I’ve now got another error though…  
Error occurred: Traceback (most recent call last): File “C:\inetpub\wwwroot\wfastcgi.py”, line 847, in main result = handler(record.params, response.start)  
TypeError: ‘Dash’ object is not callable StdOut: StdErr: C:\Python34\lib\site-packages\plotly\tools.py:103: UserWarning: Looks like you don’t have ‘read-write’ permission to your ‘home’ (’~’) directory or to our ‘~/.plotly’ directory.  
That means plotly’s python api can’t setup local configuration files. No problem though! You’ll just have to sign-in using ‘plotly.plotly.sign\_in()’. For help with that: ‘help(plotly.plotly.sign\_in)’. Questions? Visit [https://support.plot.ly](https://support.plot.ly)

Is this just relating to windows permissions?

thanks,  
Matt

---

<div class="post-metadata">

**Author:** ![eddy\_oj](https://avatars.discourse-cdn.com/v4/letter/e/3ab097/32.png) [@eddy\_oj](https://community.plotly.com/u/eddy_oj)\
**Post date:** [May 6, 2018, 6:53pm UTC](https://community.plotly.com/t/flask-windows-iis-plotly-dash-error-occured-while-reading-wsgi-handler/9911/4 "2018-05-06T18:53:32Z")

</div>

Hi @roastbeeef,

The following:

"`That means plotly’s python api can’t setup local configuration files. You'll just have to sign-in using ‘plotly.plotly.sign_in()’. For help with that: ‘help(.plotly.sign_in)’."`

Suggests to me that you might not have your dash running locally. Have you done the following:

```
app.stylesheets.serve_locally=True
app.scripts.serve_locally=True

```

Which is from the followig link:

[https://dash.plot.ly/external-resources](https://dash.plot.ly/external-resources)

---

<div class="post-metadata">

**Author:** ![eddy\_oj](https://avatars.discourse-cdn.com/v4/letter/e/3ab097/32.png) [@eddy\_oj](https://community.plotly.com/u/eddy_oj)\
**Post date:** [May 6, 2018, 6:59pm UTC](https://community.plotly.com/t/flask-windows-iis-plotly-dash-error-occured-while-reading-wsgi-handler/9911/5 "2018-05-06T18:59:14Z")

</div>

Also, if that doesnt work, see chriddy p’s answer here:

> [@\[solved\] Dash on IIS 8 - TypeError: 'Dash' object is not callable](https://community.plotly.com/t/solved-dash-on-iis-8-typeerror-dash-object-is-not-callable/5787/2):
>
> From that tutorial: [http://netdot.co/images/wsgi\_handler.png](http://netdot.co/images/wsgi_handler.png) The first app corresponds to app.py. The second app corresponds to the variable app instead the file app.py. In that example, the app variable was corresponding to the flask instance. In your example, app is the Dash app and server is the flask instance. So, I believe that you need to change this WSGI\_HANDLER to be app.server instead of app.app

---

<div class="post-metadata">

**Author:** ![comiscan](https://avatars.discourse-cdn.com/v4/letter/c/b782af/32.png) [@comiscan](https://community.plotly.com/u/comiscan)\
**Post date:** [April 21, 2020, 2:49pm UTC](https://community.plotly.com/t/flask-windows-iis-plotly-dash-error-occured-while-reading-wsgi-handler/9911/6 "2020-04-21T14:49:37Z")

</div>

I’ve met same problem. and After I uninstalled ipython, I got successful result . but I also need use jupyter notebook. After uninstall ipython, jupyter notebook does infinite loop. Is there any clear solutions?
