gpt4 book ai didi

ubuntu - ubuntu 16 上的 Shiny 服务器错误 : "unable to open connection to X11 display ' '

转载 作者:行者123 更新时间:2023-12-04 18:44:54 28 4
gpt4 key购买 nike

我正在尝试在 Ubuntu 16 aws ec2 上运行 Shiny 的仪表板,并且该示例正在部分工作:它显示仪表板控件,但显示错误消息而不是图形。

在/var/log/shinyserver 中输出错误日志:

Listening on http://127.0.0.1:35434
Warning in pngfun(filename = filename, width = width, height = height, res = res, :
unable to open connection to X11 display ''
Warning: Error in .External2: unable to start device PNG
123: pngfun
122: startPNG
121: drawPlot
107: <reactive:plotObj>
91: drawReactive
78: origRenderFunc
77: output$distPlot
1: runApp

来自/etc/shiny-server 的 shiny-server.conf:
# Instruct Shiny Server to run applications as the user "shiny"
run_as ubuntu;

# Define a server that listens on port 3838
server {
listen 3838;

# Define a location at the base URL
location / {

# Host the directory of Shiny Apps stored in this directory
site_dir /srv/shiny-server;

# Log all Shiny output to files in this directory
log_dir /var/log/shiny-server;

# When a user visits the base URL rather than a particular application,
# an index of the applications available in this directory will be shown.
directory_index on;
}
}

我在安装 R 之前尝试了几个包:xorg-dev 和 libx11-dev
但他们没有帮助:

错误图片: enter image description here

最佳答案

我在 r-base 上安装 R-3.4.0 的方式存在错误,该错误不能包含对 x11 的支持。正确的方法是首先更新 key ,这里:

apt-get install -y qpdf libx11-dev libpng12-dev libjpeg62
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
sudo add-apt-repository 'deb [arch=amd64,i386] https://cran.rstudio.com/bin/linux/ubuntu xenial/'
sudo apt-get update
sudo apt-get install r-base

代替:
wget https://cran.r-project.org/src/base/R-3/R-3.4.0.tar.gz
tar -xzf R-3.4.0.tar.gz
./configure --with-x=yes --enable-R-shlib=yes --with-cairo=yes – without-x11
make
make install

第一个安装了 3.4.0 base r,这对于我的情况来说是最新的。

关于ubuntu - ubuntu 16 上的 Shiny 服务器错误 : "unable to open connection to X11 display ' ',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51576691/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com