Closed rjoshig closed 6 years ago
Changed matplotlibrc to below:-
echo "backend: Agg" > ~/.config/matplotlib/matplotlibrc
Now it doesn't throw an error but it does not display anything either. What am i missing here?
catalyst run -f buy_and_hodl.py --start 2015-3-2 --end 2017-7-31 --capital-base 100000 -o bah.pickle
[2017-10-14 21:25:23.349705] INFO: run_algo: running algo in backtest mode
[2017-10-14 21:25:23.499095] 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 21:25:27.163971] INFO: Performance: Simulated 883 trading days out of 883.
[2017-10-14 21:25:27.164118] INFO: Performance: first open: 2015-03-02 00:00:00+00:00
[2017-10-14 21:25:27.164282] INFO: Performance: last close: 2017-07-31 23:59:00+00:00
Same issue in Ubuntu.
(catalyst-venv) root@ovh:~# lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 16.04.3 LTS Release: 16.04 Codename: xenial
(catalyst-venv) root@ovh:~# catalyst run -f buy_and_hodl.py --start 2015-3-2 --end 2017-6-28 --capital-base 100000 -o bah.pickle
[2017-10-18 04:34:56.553822] INFO: run_algo: running algo in backtest mode
[2017-10-18 04:34:56.705316] 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-18 04:35:01.258081] INFO: Performance: Simulated 850 trading days out of 850.
[2017-10-18 04:35:01.259023] INFO: Performance: first open: 2015-03-02 00:00:00+00:00
[2017-10-18 04:35:01.259226] INFO: Performance: last close: 2017-06-28 23:59:00+00:00
Traceback (most recent call last):
File "/root/catalyst-venv/bin/catalyst", line 11, in
Can either one of you confirm that you are running these commands in a local machine, vs ssh'ing remotely to another machine. If that's the case, this problem is covered elsewhere, for example: here
Alternatively, if you don't have a display, you can run matplotlib without an interactive display by saving plots to files for example, as explained here
Found this other relevant suggestion:
export DISPLAY=0.0; xhost +
from this post
Let me know if any of the above resolve your issue.
One clarification note. Catalyst doesn't need matplotlib to run, it needs matplotlib to display summary/performance charts if you so choose.
You can comment out all the code in the def analyze()
function in your algo, and just specify an output file with the -o
flag in the command line. You can then use other software to analyze the results, such as pyfolio.
I am using Windows Subsystem for Linux and logged in via ssh using Putty. I tried the ssh -X option . Still not working. Thanks for taking time to help us. I will try and figure out this display thing.
Question
catalyst run -f buy_and_hodl.py --start 2017-3-2 --end 2017-7-31 --capital-base 100000 -o bah.pickle
Then I started jupyter
jupyter notebook
I can see that .ipynb
are generated.
-rw-rw-r-- 1 ethdev ethdev 195688 Oct 19 19:29 Untitled.ipynb
Is this file generated ? Can i specify the filename? if yes how?
What exactly is bah.pickle in the command above? Is this the output of the run.
Bascically how do i generate the ipynb
file using the run.
Closing this issue, since it's not specific to catalyst, but to the specific running environment and matplotlib. See my first post above for alternative setups.
@mesnia, please open different issues to report different problems, otherwise it's hard to keep track of them. But answering your question on number 3, inside jupyter notebook, go to File -> Rename. This will rename the current notebook, and use that for the filename to save it on disk.
the pickle is the output of the catalyst simulation that contains the performance data of your algorithm. The .ipynb is a copy of the jupyter network that you just created, which is the list of commands you have run, and the results from running these commands, so they are two very different files.
I have coding:
import matplotlib.pyplot as plt
import numpy as np import matplotlib.pyplot as plt n = 1000 X = np.linspace(-np.pi, np.pi, 256, endpoint=True) C,S = np.cos(X), np.sin(X) plt.plot(X, C) plt.plot(X,S) plt.show() When I am running the above example in the server through the laptop windows connected to the server's ubuntu, the following error appears: Please help me? I followed this link: https://stackoverflow.com/questions/37604289/tkinter-tclerror-no-display-name-and-no-display-environment-variable but failed thank you! I
Hi, could anyone find a fix for @mautc12 's problem
As posted above, this issue is unrelated to Catalyst, and there are many different configurations that can cause and resolve this issue. First of all, we don't have enough information about @mautc12's environment to resolve this issue. Some possible troublehsooting that you would need to figure out before attempting to display any Catalyst output would be:
Once you have all of the above pieces installed, and working, you may need to tweak their configuration and test them using something as simple as opening an instance of xterm
remotely and have it appear in your local environment. Once you have that, you can start tackling the Catalyst-specific errors, so as you can see this is mostly unrelated to Catalyst.
@lacabra 's answer should solve this issue. You need a XQuartz or similar software on client and configure your server config with X11 Forwarding yes something.
@mautc12 i am also having the same issue can tou help me with that? thanks in advance
Hi, I am running python via binder and would like to run a GUI code. Having done from tkinter import *
I get the following error: (I am not sure what is wrong.. is it saying I dont have the correct environment?) Please help!
TclError Traceback (most recent call last)
I ran into the same issue and set this in my code.
import Tkinter
import sys
import os
if os.environ.get('DISPLAY','') == '':
print('no display found. Using :0.0')
os.environ.__setitem__('DISPLAY', ':0.0')
#create main window
master = Tkinter.Tk()
master.title("tester")
master.geometry("300x100")
#make a label for the window
label1 = Tkinter.Label(master, text='Hellooooo')
# Lay out label
label1.pack()
# Run forever!
master.mainloop()
I ran into the same issue and set this in my code.
import Tkinter import sys import os if os.environ.get('DISPLAY','') == '': print('no display found. Using :0.0') os.environ.__setitem__('DISPLAY', ':0.0') #create main window master = Tkinter.Tk() master.title("tester") master.geometry("300x100") #make a label for the window label1 = Tkinter.Label(master, text='Hellooooo') # Lay out label label1.pack() # Run forever! master.mainloop()
Thank you so much for posting this - worked for me! I downloaded Xming and set the display using the os.environ setitem() function and Xming was able to display my Tkinter application.
If we used a windows OS then we need to install Xming server. Try to connect putty and change the setting of putty is ssh>x11>enable X11 forwarding
After setting
if os.environ.get('DISPLAY','') == '': print('no display found. Using :0.0') os.environ.setitem('DISPLAY', ':0.0')
I am getting below issue.
window=tkinter.Tk() File "/usr/lib64/python3.6/tkinter/init.py", line 2023, in init self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use) _tkinter.TclError: couldn't connect to display ":0.0"
Can anyone help please I am running code in Linux
MauTC da nhan duoc mail, xin cam on!
After setting
if os.environ.get('DISPLAY','') == '': print('no display found. Using :0.0') os.environ.setitem('DISPLAY', ':0.0')
I am getting below issue.
window=tkinter.Tk() File "/usr/lib64/python3.6/tkinter/init.py", line 2023, in init self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use) _tkinter.TclError: couldn't connect to display ":0.0"
Can anyone help please I am running code in Linux
Dear Catalyst Maintainers,
Before I tell you about my issue, let me describe my environment:
Environment
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.
ethdev@DESKTOP { ~/.config/matplotlib }$ cat matplotlibrc backend: TkAgg