# Dash Plotly not compatible with IIS

**URL:** <https://community.plotly.com/t/dash-plotly-not-compatible-with-iis/11549>\
**Category:** Dash Python\
**Created:** [July 6, 2018, 10:20am UTC](https://community.plotly.com/t/dash-plotly-not-compatible-with-iis/11549 "2018-07-06T10:20:58Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![SMH](https://avatars.discourse-cdn.com/v4/letter/s/90ced4/32.png) [@SMH](https://community.plotly.com/u/SMH)\
**Post date:** [July 6, 2018, 10:20am UTC](https://community.plotly.com/t/dash-plotly-not-compatible-with-iis/11549/1 "2018-07-06T10:20:58Z")

</div>

Error occurred : Traceback (most recent call last): File “E:\IndustryDashboard\wfastcgi.py”, line 794, in main env, handler = read\_wsgi\_handler(response.physical\_path) File “E:\IndustryDashboard\wfastcgi.py”, line 636, in read\_wsgi\_handler handler = get\_wsgi\_handler(os.getenv(“WSGI\_HANDLER”)) File “E:\IndustryDashboard\wfastcgi.py”, line 603, in get\_wsgi\_handler handler = **import** (module\_name, fromlist=[name\_list[0][0]]) File “.\Analyst\_app.py”, line 9, in plotly.tools.set\_credentials\_file(username=‘Indospirit’, api\_key=‘xXEe2QiGUZPXMbglNZko’) File “C:\Python\Python37-32\lib\site-packages\plotly\tools.py”, line 128, in set\_credentials\_file raise exceptions.PlotlyError("You don’t have proper file permissions " plotly.exceptions.PlotlyError: You don’t have proper file permissions to run this function. StdOut: StdErr: C:\Python\Python37-32\lib\site-packages\plotly\tools.py:102: 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)

WSGI is unable to acces plotly files as required thus, the whole app falls apart.

---

<div class="post-metadata">

**Author:** ![Philippe](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/philippe/32/3521_2.png) [@Philippe](https://community.plotly.com/u/Philippe)\
**Post date:** [July 6, 2018, 8:06pm UTC](https://community.plotly.com/t/dash-plotly-not-compatible-with-iis/11549/2 "2018-07-06T20:06:51Z")

</div>

Instead of using the credentials files, which the IIS user doesn’t have access, can you try putting your keys in environ vars ?

The env vars you need:

`PLOTLY_USERNAME`  
`PLOTLY_API_KEY`

And maybe those if you need the `.configs` file.

`PLOTLY_DOMAIN`  
`PLOTLY_API_DOMAIN`

---

<div class="post-metadata">

**Author:** ![jbrown15](https://avatars.discourse-cdn.com/v4/letter/j/edb3f5/32.png) [@jbrown15](https://community.plotly.com/u/jbrown15)\
**Post date:** [August 3, 2018, 3:12pm UTC](https://community.plotly.com/t/dash-plotly-not-compatible-with-iis/11549/3 "2018-08-03T15:12:26Z")

</div>

Can you please give an example of where I can find the files to update these ENV variables?

---

<div class="post-metadata">

**Author:** ![Philippe](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/philippe/32/3521_2.png) [@Philippe](https://community.plotly.com/u/Philippe)\
**Post date:** [August 3, 2018, 3:15pm UTC](https://community.plotly.com/t/dash-plotly-not-compatible-with-iis/11549/4 "2018-08-03T15:15:22Z")

</div>

The files are in `~/.plotly`.

---

<div class="post-metadata">

**Author:** ![jbrown15](https://avatars.discourse-cdn.com/v4/letter/j/edb3f5/32.png) [@jbrown15](https://community.plotly.com/u/jbrown15)\
**Post date:** [August 3, 2018, 3:25pm UTC](https://community.plotly.com/t/dash-plotly-not-compatible-with-iis/11549/5 "2018-08-03T15:25:36Z")

</div>

Thanks Phillippe, i dont see a place in the .config or .credential files for environ vars. Where am I supposed to update the ENV variables?

---

<div class="post-metadata">

**Author:** ![Philippe](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/philippe/32/3521_2.png) [@Philippe](https://community.plotly.com/u/Philippe)\
**Post date:** [August 3, 2018, 3:44pm UTC](https://community.plotly.com/t/dash-plotly-not-compatible-with-iis/11549/6 "2018-08-03T15:44:48Z")

</div>

You don’t update them in a file, you have to set like so:

Linux:  
`$ export PLOTLY_USERNAME=my-username`

Windows:

`setx PLOTLY_USERNAME=my-username`

Python:

```python
import os

os.environ['PLOTLY_USERNAME'] = 'my-username'

```

---

<div class="post-metadata">

**Author:** ![jbrown15](https://avatars.discourse-cdn.com/v4/letter/j/edb3f5/32.png) [@jbrown15](https://community.plotly.com/u/jbrown15)\
**Post date:** [August 3, 2018, 3:57pm UTC](https://community.plotly.com/t/dash-plotly-not-compatible-with-iis/11549/7 "2018-08-03T15:57:30Z")

</div>

thanks Philippe.

My app.py file has the following

import dash

from dash.dependencies import Input, Output

import dash\_core\_components as dcc

import dash\_html\_components as html

import plotly.graph\_objs as go

import pandas as pd

import os

import plotly

plotly.tools.set\_credentials\_file(username=“jabrown10”, api\_key=“pFozcI42TMpXne3vGBoE”)

import plotly.plotly as py

py.sign\_in(“jabrown10”, “jv281316N”)

os.environ[‘PLOTLY\_USERNAME’] = ‘\*\*\*\*\*\*\*\*’

os.environ[‘PLOTLY\_API\_KEY’] = ‘xxxxxxxxxxxxxxxxxx’

os.environ[‘PLOTLY\_DOMAIN’] = ‘[https://plot.ly](https://plot.ly)’

os.environ[‘PLOTLY\_API\_DOMAIN’] = ‘[https://api.plot.ly](https://api.plot.ly)’

and I also set the above keys as Environment variables on my system but I continue to get the same error

Error occurred while reading WSGI handler:

Traceback (most recent call last):  
File “C:\inetpub\wwwroot\myapp\app\wfastcgi.py”, line 791, in main  
env, handler = read\_wsgi\_handler(response.physical\_path)  
File “C:\inetpub\wwwroot\myapp\app\wfastcgi.py”, line 633, in read\_wsgi\_handler  
handler = get\_wsgi\_handler(os.getenv(“WSGI\_HANDLER”))  
File “C:\inetpub\wwwroot\myapp\app\wfastcgi.py”, line 600, in get\_wsgi\_handler  
handler = **import** (module\_name, fromlist=[name\_list[0][0]])  
File “C:\inetpub\wwwroot\myapp\app\index.py”, line 20, in   
plotly.tools.set\_credentials\_file(username="\*\*\*\*\*\*", api\_key=“xxxxxxxxxxxxxxx”)  
File “C:\Python36\lib\site-packages\plotly\tools.py”, line 128, in set\_credentials\_file  
raise exceptions.PlotlyError("You don’t have proper file permissions "  
plotly.exceptions.PlotlyError: You don’t have proper file permissions to run this function.

StdOut:

StdErr: C:\Python36\lib\site-packages\plotly\tools.py:102: 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)

---

<div class="post-metadata">

**Author:** ![Philippe](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/philippe/32/3521_2.png) [@Philippe](https://community.plotly.com/u/Philippe)\
**Post date:** [August 3, 2018, 4:47pm UTC](https://community.plotly.com/t/dash-plotly-not-compatible-with-iis/11549/8 "2018-08-03T16:47:42Z")

</div>

You need to remove the `plotly.tools.set_credentials_file(username=“xx”, api_key=“xx”)`, setting them on the system is the right way to do it and you can remove the `os.environ` part if you do.

---

<div class="post-metadata">

**Author:** ![jbrown15](https://avatars.discourse-cdn.com/v4/letter/j/edb3f5/32.png) [@jbrown15](https://community.plotly.com/u/jbrown15)\
**Post date:** [August 3, 2018, 5:32pm UTC](https://community.plotly.com/t/dash-plotly-not-compatible-with-iis/11549/9 "2018-08-03T17:32:18Z")

</div>

Thanks That did the trick!
