Error "cannot connect to X server localhost:14.0"

1,653 views
Skip to first unread message

Adam Witney

unread,
May 20, 2016, 5:51:10 AM5/20/16
to Qiime 1 Forum

Hi, 

I am running summarize_taxa_through_plots.py, but it gives an X11 error as shown below. I guess this is about it trying to create an X window session, on my server? Is it possible to just switch this behaviour off? All i need are the image files for output i don't need it to open an X window session

This is v1.9.1 by the way

Thanks

Adam

*** ERROR RAISED DURING STEP: Plot Taxonomy Summary
Command run was:
 plot_taxa_summary.py -i wf_taxa_summary/merged_L2.txt,wf_taxa_summary/merged_L3.txt,wf_taxa_summary/merged_L4.txt,wf_taxa_summary/merged_L5.txt,wf_taxa_summary/merged_L6.txt -o wf_taxa_summary/taxa_summary_plots/ --y_height 8 --chart_type bar
Command returned exit status: 1
Stdout:

Stderr
Xlib: connection to "localhost:14.0" refused by server
Xlib: MobaXterm X11 proxy: Authorisation not recognised

 : cannot connect to X server localhost:14.0

Greg Caporaso

unread,
May 20, 2016, 1:02:31 PM5/20/16
to Qiime 1 Forum
Hi Adam,
This just came up for a different user - my guess is that it's an issue with the matplotlib backend. Could you try following the steps I'm describing here to switch to a backend that doesn't require an Xserver? I'll be interested to know whether this works for you.

Greg

Adam Witney

unread,
May 21, 2016, 4:44:06 PM5/21/16
to Qiime 1 Forum

Hi Greg,

 

Thanks for your reply.

 

I tried this

 

mkdir $HOME/.matplotlib

echo "backend : agg" > $HOME/.matplotlib/matplotlibrc

 

but this didn’t seem to make any difference. I get the same error.

 

By the way I am using a local anaconda install of python if that makes any difference

 

Adam

 

Greg Caporaso

unread,
May 23, 2016, 10:53:38 AM5/23/16
to Qiime 1 Forum
Hi Adam,
Can you please run the following two commands for me and reply with the output:

echo $DISPLAY
python -c "import matplotlib; print(matplotlib.get_backend())"

Greg

Adam Witney

unread,
May 23, 2016, 11:39:39 AM5/23/16
to Qiime 1 Forum
Hi Greg,

here is the output

$ echo $DISPLAY
localhost:14.0
$ python -c "import matplotlib; print(matplotlib.get_backend())"
Qt4Agg

Adam

Greg Caporaso

unread,
May 23, 2016, 6:47:59 PM5/23/16
to Qiime 1 Forum
Hey Adam, If that echo command that I gave you worked to update the config file, this should have returned agg. Could you post the contents of the config file - you can get that as follows:

cat $HOME/.matplotlib/matplotlibrc

Adam Witney

unread,
May 23, 2016, 7:21:50 PM5/23/16
to Qiime 1 Forum
Hi Greg,

here it is:

$ cat $HOME/.matplotlib/matplotlibrc
backend : agg
$ python -c "import matplotlib; print(matplotlib.get_backend())"
Qt4Agg

Thanks again

Adam

Adam Witney

unread,
May 25, 2016, 4:24:00 AM5/25/16
to Qiime 1 Forum

Hi Greg,

just an update, after you pointing me in the right direction, I managed to solve this. I needed to set MATPLOTLIBRC  first:

$ setenv MATPLOTLIBRC ~/.matplotlib

$ less $MATPLOTLIBRC/matplotlibrc

backend : agg

$ python -c "import matplotlib; print(matplotlib.get_backend())"

agg


and it now works ok


thanks again


Adam


Greg Caporaso

unread,
May 25, 2016, 11:36:08 AM5/25/16
to Qiime 1 Forum
Excellent, thanks for the update! 

Greg
Reply all
Reply to author
Forward
0 new messages