Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/65.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
无法生成R包“;巴布亚新几内亚“;软呢帽20_R_Installation_Libpng_Fedora20 - Fatal编程技术网

无法生成R包“;巴布亚新几内亚“;软呢帽20

无法生成R包“;巴布亚新几内亚“;软呢帽20,r,installation,libpng,fedora20,R,Installation,Libpng,Fedora20,我正在尝试构建R包,回购协议说libpng需要可用 我运行Linux Fedora 20发行版 看起来我有 [root@localhost bin]# yum install libpng Loaded plugins: langpacks, refresh-packagekit Package 2:libpng-1.6.3-3.fc20.x86_64 already installed and latest version Nothing to do 但当我尝试安装它时: > inst

我正在尝试构建
R
包,回购协议说
libpng
需要可用

我运行Linux Fedora 20发行版

看起来我有

[root@localhost bin]# yum install libpng
Loaded plugins: langpacks, refresh-packagekit
Package 2:libpng-1.6.3-3.fc20.x86_64 already installed and latest version
Nothing to do
但当我尝试安装它时:

> install.packages("png")
Installing package into ‘/home/statquant/R/x86_64-redhat-linux-gnu-library/3.0’
(as ‘lib’ is unspecified)
trying URL 'http://cran.rstudio.com/src/contrib/png_0.1-7.tar.gz'
Content type 'application/x-gzip' length 24990 bytes (24 Kb)
opened URL
==================================================
downloaded 24 Kb

* installing *source* package ‘png’ ...
** package ‘png’ successfully unpacked and MD5 sums checked
** libs
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG  -I/usr/local/include    `libpng-config --cflags` -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches  -m64 -mtune=generic  -c read.c -o read.o
/bin/sh: libpng-config: command not found
read.c:3:17: fatal error: png.h: No such file or directory
 #include <png.h>
                 ^
compilation terminated.
make: *** [read.o] Error 1
ERROR: compilation failed for package ‘png’
* removing ‘/home/statquant/R/x86_64-redhat-linux-gnu-library/3.0/png’

The downloaded source packages are in
        ‘/tmp/RtmpG5MjG9/downloaded_packages’
Warning message:
In install.packages("png") :
  installation of package ‘png’ had non-zero exit status
>install.packages(“png”)
将包安装到“/home/statquant/R/x86_64-redhat-linux-gnu-library/3.0”中
(由于“lib”未指定)
正在尝试URL'http://cran.rstudio.com/src/contrib/png_0.1-7.tar.gz'
内容类型“应用程序/x-gzip”长度24990字节(24KB)
打开的URL
==================================================
下载24KB
*正在安装*source*包“png”。。。
**包“png”已成功解包并检查MD5总和
**自由基
gcc-m64-std=gnu99-I/usr/include/R-DNDEBUG-I/usr/local/include`libpng-config-cflags`-fpic-O2-g-pipe-Wall-Wp-D_-FORTIFY_-SOURCE=2-feexceptions-fstack-protector-strong-param=ssp buffer size=4-grecord gcc-m64-mtune=generic-read.c-o-read.o
/bin/sh:libpng配置:未找到命令
read.c:3:17:致命错误:png.h:没有这样的文件或目录
#包括
^
编译终止。
make:**[read.o]错误1
错误:包“png”的编译失败
*删除“/home/statquant/R/x86_64-redhat-linux-gnu-library/3.0/png”
下载的源程序包位于中
“/tmp/RtmpG5MjG9/下载的_软件包”
警告信息:
在install.packages(“png”)中:
包“png”的安装具有非零退出状态

对于某些R软件包,您需要相应的开发库才能成功安装R软件包。在您的情况下,这应该满足您的需要

# Do the following in your terminal (not in an R session)
yum install libpng-devel
之后,您应该能够安装R软件包

# Do the following in the R console (during an R session)
install.packages("png")

我在Ubuntu(16.04)上遇到了同样的问题,并使用

sudo apt-get install libpng-dev

很多时候,软件包需要开发软件包。尝试
yum安装libpng-devel
,然后尝试重新安装。你就是那个!信息技术works@Dason,请随便回答。@RomanLuštrik我很久没用软呢帽了,所以我不确定这是否是问题所在。不过我会把它移到一个答案上来。这对我来说也很有用。我从源代码构建了R2.15.3,虽然我有libpng.so文件可以链接,但在构建PNG功能之前,我仍然需要开发包。配置完成后,您将在配置摘要中将其视为“附加功能”之一。我没有将其作为“包”安装。当我们使用非Fedora发行版时,对于OpenSUSE:只需打开YaST,检查已安装的libpng(在我的例子中为libpng16-16),并添加相应的-devel(在我的例子中为libpng16-devel)。在那之后,R在安装软件包时没有任何问题。我正在使用LinuxMint,这为我解决了这个问题-谢谢:)