'ERR_CONNECTION_REFUSED on browser when opening dtale with Eclipse Pydev
Opening a dtale sheet using Eclipse Pydev on Windows leads to ERR_CONNECTION_REFUSED on browser. The same code works on spyder and jupyter however. I know dtale uses a flask backend but I am inexperienced in flask. Any advice or workaround is welcome but I specifically want to use pydev because of familiarity. The code and output is attached below.
code:
import pandas as pd
import dtale
import dtale.app as dtale_app
# Class=input("Enter Class: ").upper()
Class="A"
pathname="Data/"+Class+".xlsx"
df=pd.read_excel(pathname,header=None)
d=dtale.show(df)
print(d)
d.open_browser()
output:
2021-07-09 21:13:28,554 - INFO - NumExpr defaulting to 8 threads.
0 1 2 3 4 5 6 ... 4089 4090 4091 4092 4093 4094 4095
0 12 22 35 45 69 74 79 ... -21 -14 -14 -25 -28 -11 8
1 -56 -50 -64 -91 -135 -140 -134 ... -114 -138 -159 -172 -180 -173 -162
2 -37 -22 -17 -24 -31 -20 -5 ... -23 -14 -5 -3 7 3 4
3 -31 -43 -39 -39 -9 -5 18 ... -40 -23 -1 11 12 -6 10
4 14 26 32 25 16 8 8 ... -29 -35 -51 -55 -58 -32 -6
.. ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
95 -133 -144 -113 -74 -41 -41 -61 ... -70 -58 -62 -71 -79 -83 -87
96 -3 -3 -12 -24 -34 -42 -41 ... 31 54 61 55 42 30 19
97 -51 -42 -39 -47 -51 -46 -29 ... -7 -16 -18 -9 2 -2 0
98 56 55 38 -5 -47 -72 -79 ... 36 41 14 -27 -45 -32 -4
99 -36 -71 -120 -150 -160 -133 -96 ... 39 57 44 41 14 3 -13
[100 rows x 4096 columns]
Solution 1:[1]
I would try hitting http://localhost:40000/dtale/main/1 in the browser. If that works then you can update your code to use
d = dtale.show(df, host=‘localhost’)
sometimes the computer name is accessible from the browser. You can also try ‘0.0.0.0’ as the host.
Solution 2:[2]
I think you should add localhost and use subprocess:
d = dtale.show(df, host='localhost', subprocess=False)
Also, check your windows firewall settings: https://github.com/man-group/dtale#issues-with-windows-firewall
Solution 3:[3]
I just figured out that your IDE must also be enabled in the windows firewall for it to work.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Andrew Schonfeld |
Solution 2 | |
Solution 3 | Sachin200 |