Repository: scrtlabs/catalyst

Issue #39: _tkinter.TclError: no display name and no $DISPLAY environment variable
Created: 2017-10-14T20:23:26Z
Dear Catalyst Maintainers,
Before I tell you about my issue, let me describe my environment:
Environment

* Operating System: (Windows Subsystem For Linux )--  Linux DESKTOP 4.4.0-43-Microsoft #1-Microsoft Wed Dec 31 14:42:53 PST 2014 x86_64 x86_64 x86_64 GNU/Linux
* Python Version: Python 2.7.12
* Python Bitness: 64
* How did you install Catalyst: pip (virtual environment)
* Python packages: `$ pip freeze` 


alembic==0.7.7
backports.functools-lru-cache==1.4
bcolz==0.12.1
Bottleneck==1.0.0
certifi==2017.7.27.1
chardet==3.0.4
click==4.0
contextlib2==0.4.0
cycler==0.10.0
cyordereddict==0.2.2
Cython==0.25.2
decorator==4.0.0
empyrical==0.2.1
enigma-catalyst==0.2.dev5
idna==2.6
intervaltree==2.1.0
Logbook==0.12.5
lru-dict==1.1.4
Mako==1.0.1
MarkupSafe==0.23
matplotlib==2.1.0
multipledispatch==0.4.8
networkx==1.9.1
numexpr==2.6.1
numpy==1.13.1
pandas==0.19.2
pandas-datareader==0.2.1
patsy==0.4.0
pkg-resources==0.0.0
pyparsing==2.2.0
python-dateutil==2.4.2
python-editor==1.0.3
pytz==2016.4
requests==2.9.1
requests-file==1.4.1
requests-ftp==0.3.1
scipy==0.17.1
six==1.10.0
sortedcontainers==1.4.4
SQLAlchemy==1.0.8
statsmodels==0.6.1
subprocess32==3.2.7
tables==3.3.0
toolz==0.8.2
urllib3==1.22

Now that you know a little about me, let me tell you about the issue I am
having:
Description of Issue
No able to run. It seems to be display issue.

I am running Windows subsystem for Linux
Connected to a VGA monitor from a laptop  HDMI-VGA converter cable.


Error logs below

ethdev@DESKTOP-D3T3450 { ~/catalyst-venv/catalyst/catalyst/examples }$ catalyst run -f buy_and_hodl.py --start 2015-3-2 --end 2017-7-31 --capital-base 100000 -o bah.pickle
[2017-10-14 20:06:26.544295] INFO: run_algo: running algo in backtest mode
[2017-10-14 20:06:26.688107] INFO: Loader: Loading benchmark data for 'USDT_BTC' from 2015-03-02 00:00:00+00:00 to 2017-10-03 00:00:00
[2017-10-14 20:06:30.169306] INFO: Performance: Simulated 883 trading days out of 883.
[2017-10-14 20:06:30.169431] INFO: Performance: first open: 2015-03-02 00:00:00+00:00
[2017-10-14 20:06:30.169596] INFO: Performance: last close: 2017-07-31 23:59:00+00:00
Traceback (most recent call last):
  File "/home/ethdev/catalyst-venv/bin/catalyst", line 11, in <module>
    sys.exit(main())
  File "/home/ethdev/catalyst-venv/local/lib/python2.7/site-packages/click/core.py", line 664, in __call__
    return self.main(*args, **kwargs)
  File "/home/ethdev/catalyst-venv/local/lib/python2.7/site-packages/click/core.py", line 644, in main
    rv = self.invoke(ctx)
  File "/home/ethdev/catalyst-venv/local/lib/python2.7/site-packages/click/core.py", line 991, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/ethdev/catalyst-venv/local/lib/python2.7/site-packages/click/core.py", line 837, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/ethdev/catalyst-venv/local/lib/python2.7/site-packages/click/core.py", line 464, in invoke
    return callback(*args, **kwargs)
  File "/home/ethdev/catalyst-venv/local/lib/python2.7/site-packages/catalyst/__main__.py", line 98, in _
    return f(*args, **kwargs)
  File "/home/ethdev/catalyst-venv/local/lib/python2.7/site-packages/catalyst/__main__.py", line 294, in run
    live_graph=live_graph
  File "/home/ethdev/catalyst-venv/local/lib/python2.7/site-packages/catalyst/utils/run_algo.py", line 362, in _run
    overwrite_sim_params=False,
  File "/home/ethdev/catalyst-venv/local/lib/python2.7/site-packages/catalyst/algorithm.py", line 749, in run
    self.analyze(daily_stats)
  File "/home/ethdev/catalyst-venv/local/lib/python2.7/site-packages/catalyst/algorithm.py", line 490, in analyze
    self._analyze(self, perf)
  File "buy_and_hodl.py", line 83, in analyze
    ax1 = plt.subplot(611)
  File "/home/ethdev/catalyst-venv/local/lib/python2.7/site-packages/matplotlib/pyplot.py", line 1052, in subplot
    fig = gcf()
  File "/home/ethdev/catalyst-venv/local/lib/python2.7/site-packages/matplotlib/pyplot.py", line 588, in gcf
    return figure()
  File "/home/ethdev/catalyst-venv/local/lib/python2.7/site-packages/matplotlib/pyplot.py", line 534, in figure
    **kwargs)
  File "/home/ethdev/catalyst-venv/local/lib/python2.7/site-packages/matplotlib/backend_bases.py", line 170, in new_figure_manager
    return cls.new_figure_manager_given_figure(num, fig)
  File "/home/ethdev/catalyst-venv/local/lib/python2.7/site-packages/matplotlib/backends/backend_tkagg.py", line 1049, in new_figure_manager_given_figure
    window = Tk.Tk(className="matplotlib")
  File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1818, in __init__
    self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: no display name and no $DISPLAY environment variable


Here is how you can reproduce this issue on your machine:
Reproduction Steps

Connect your laptop to VGA monitor using HDMI-VGA converter cable
Run command below
catalyst run -f buy_and_hodl.py --start 2015-3-2 --end 2017-7-31 --capital-base 100000 -o bah.pickle
...

What steps have you taken to resolve this already?

export DISPLAY=:0 and run,same error
export DISPLAY=0.0 and run, same error
export DISPLAY=:0.0 and run, same error
Tried different combination of export DISPLAY
Created file below

ethdev@DESKTOP { ~/.config/matplotlib }$ cat matplotlibrc
backend: TkAgg


Tried this one too
echo "backend: TkAgg" > ~/.matplotlib/matplotlibrc

Anything else?
No additional details
Sincerely,
mesnia

Duplicate issue #231: _tkinter.TclError: no display name and no $DISPLAY environment variable
Created: 2018-02-13T08:14:45Z
Dear Catalyst Maintainers,
Before I tell you about my issue, let me describe my environment:
Environment

Operating System: (Windows Version or $ uname --all)
Python Version: $ python --version
Python Bitness: $ python -c 'import math, sys;print(int(math.log(sys.maxsize + 1, 2) + 1))'
How did you install Catalyst: (pip, conda, or other (please explain))
Python packages: $ pip freeze or $ conda list

Now that you know a little about me, let me tell you about the issue I am
having:
Description of Issue
i'm running mininet/examples/miniedit.py in MIninet
i received this issue.
MiniEdit running against Mininet 2.2.2
Traceback (most recent call last):
File "mininet/examples/miniedit.py", line 3579, in 
app = MiniEdit()
File "mininet/examples/miniedit.py", line 1110, in init
Frame.init( self, parent )
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 2537, in init
Widget.init(self, master, 'frame', cnf, {}, extra)
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 2049, in init
BaseWidget._setup(self, master, cnf)
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 2024, in _setup
_default_root = Tk()
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1767, in init
self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: no display name and no $DISPLAY environment variable
Sincerely,
`sekar

Closing comment (2018-02-13T17:16:33Z): Duplicate of #39, where this is resolved. It is also covered in our documentation here:
https://enigmampc.github.io/catalyst/install.html#macos-virtualenv-conda-matplotlib