Centos7_miniconda_devtools安装_R语言入门之R包的安装

因为有同事反馈安装R包很慢或卡住,提供了一个安装R包的命令给我测试,在安装过程中复现报错信息,把下载慢或卡顿的链接中的域名在防火墙中调整出口。

devtools::install_github("GreenleafLab/ArchR", ref="master", repos = BiocManager::repositories())

下载安装miniconda

wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
chmod +x Miniconda3-latest-Linux-x86_64.sh #给下载下来的安装文件添加执行权限
sudo bash Miniconda3-latest-Linux-x86_64.sh

一路Enter----yes—yes直到安装完成
进入conda环境

source ~/.bashrc
conda

国内换源

#全部清华园,备用conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/MindSpore
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/Paddle
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/auto
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/biobakery
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/c4aarch64
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/caffe2
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/deepmodeling
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/dglteam
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/fastai
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/fermi
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/idaholab
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/intel
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/matsci
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/menpo/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/mordred-descriptor
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/numba
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/ohmeta
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/omnia
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/peterjc123
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/plotly
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/psi4
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch-lts
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch-test
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch3d
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pyviz
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/qiime2
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/rapidsai
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/rdkit
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/simpleitk
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/stackless
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/ursky

 安装下R语言运行环境,安装R4.0.0(开始时安装R4.3.1提示不支持某个插件,具体不记得了)

conda search R

 创建R4.0环境

conda create -n r4.0

进入R4.0环境 

conda activate r4.0

安装R4.0

conda install R=4.0 -y

 

进入R程序 

 

安装devtools

install.packages("devtools")

 安装R包报错:

1) grab failed: window not viewable.

Error in structure(.External(.C_dotTclObjv, objv), class = "tclObj") : 
[tcl] grab failed: window not viewable.

一般发生在远程linux系统中安装R包,是因为R调用窗口失败,解决方法是

chooseCRANmirror(graphics=FALSE)

输入16回车,再运行一次安装命令。

install.packages("devtools")

 可能还会有下面出错信息

1: In install.packages("devtools", dependencies = TRUE) :安装程序包‘systemfonts’时退出狀態的值不是0
2: In install.packages("devtools", dependencies = TRUE) :安装程序包‘textshaping’时退出狀態的值不是0
3: In install.packages("devtools", dependencies = TRUE) :安装程序包‘ragg’时退出狀態的值不是0
4: In install.packages("devtools", dependencies = TRUE) :安装程序包‘pkgdown’时退出狀態的值不是0
5: In install.packages("devtools", dependencies = TRUE) :安装程序包‘devtools’时退出狀態的值不是0

解决办法: 

 1.install.packages('fontconfig')根据报错提示安装

    yum install fontconfig-devel
   
 2.install.packages('textshaping')根据报错提示安装

   yum install -y  harfbuzz-devel fribidi-devel
   
 3.install.packages('ragg')根据报错提示安装

yum install -y freetype-devel libpng-devel libtiff-devel libjpeg-devel

 4.处理完1.2.3再安装下面包已经不再提示错误了。
 install.packages('pkgdown')

处理完再试试安装devtools.

在R中使用devtools安装R包

devtools::install_github("GreenleafLab/ArchR", ref="master", repos = BiocManager::repositories())

 例如生信分析常用到的Bioconductor,可使用BiocManager::install()来进行安装,例如安装DESeq2包

if (!require("BiocManager", quietly = TRUE))install.packages("BiocManager")BiocManager::install("DESeq2")

又报出错。

ERROR: dependencies ‘SummarizedExperiment’, ‘rhdf5’, ‘motifmatchr’, ‘chromVAR’, ‘uwot’, ‘Rsamtools’, ‘Biostrings’, ‘ComplexHeatmap’, ‘GenomicRanges’ are not available for package ‘ArchR’
* removing ‘/root/miniconda3/envs/r4.0/lib/R/library/ArchR’

使用pacman包来批量安装依赖包

install.packages("pacman")

使用p_install函数,并通过packages参数传入要安装的包名列表:

pacman::p_install(packages = c("SummarizedExperiment", "rhdf5", "motifmatchr", "chromVAR", "uwot", "Rsamtools", "Biostrings", "ComplexHeatmap", "GenomicRanges"))

出现ERROR: dependency ‘locfit’ is not available for package ‘DESeq2’ 的报错。此时往往是由于默认安装的locfit版本的问题导致的,所以通过指定低一点的版本(例如1.5-9.2)即可安装。

install.packages('https://cran.r-project.org/src/contrib/Archive/locfit/locfit_1.5-9.2.tar.gz',repos = NULL)

出错揭示:

checking for gcc... no
checking for cc... no
checking for cl.exe... no
checking for clang... no
configure: error: in `/tmp/RtmpuOjLUv/R.INSTALLe06dd4f1f4256/XML':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details
ERROR: configuration failed for package ‘XML’
* removing ‘/root/miniconda3/envs/r4.0/lib/R/library/XML’
* installing *source* package ‘BiocParallel’ ...
** using staged installation
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/tmp/RtmpsFlbCG/R.INSTALLe075b1e0ffb7b/BiocParallel':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details

由于本机缺少gcc编译环境,通过yum安装gcc编译环境:

yum install -y gcc

再次运行安装,提示出错信息如下

* DONE (BiocParallel)
ERROR: dependency ‘XML’ is not available for package ‘annotate’
* removing ‘/root/miniconda3/envs/r4.0/lib/R/library/annotate’
ERROR: dependency ‘annotate’ is not available for package ‘genefilter’
* removing ‘/root/miniconda3/envs/r4.0/lib/R/library/genefilter’
ERROR: dependency ‘annotate’ is not available for package ‘geneplotter’
* removing ‘/root/miniconda3/envs/r4.0/lib/R/library/geneplotter’
ERROR: dependencies ‘genefilter’, ‘geneplotter’ are not available for package ‘DESeq2’
* removing ‘/root/miniconda3/envs/r4.0/lib/R/library/DESeq2’

 安装xml

install.packages('XML')

提示出错:

You are trying to use a version 2.* edition of libxml
but an incompatible library. The header files and library seem to be
mismatched. If you have specified LIBXML_INCDIR, make certain to also
specify an appropriate LIBXML_LIBDIR if the libxml2 library is not in the default
directories.
ERROR: configuration failed for package ‘XML’
* removing ‘/root/miniconda3/envs/r4.0/lib/R/library/XML’下载的程序包在‘/tmp/Rtmp6sGhlh/downloaded_packages’里
更新'.Library'里的HTML程序包列表
Making 'packages.html' ... 做完了。
Warning message:
In install.packages("XML") : 安装程序包‘XML’时退出狀態的值不是0

进入R,

>Sys.setenv(XML_CONFIG="/usr/bin/xml2-config") #指定安装时libxml2的目录

>install.packages("XML")

xml安装完成。

再运行一次

if (!require("BiocManager", quietly = TRUE))install.packages("BiocManager")BiocManager::install("DESeq2")

全部安装成功。

参考文章:Miniconda3环境配置,换国内源_miniconda换源-CSDN博客

参考文章:没有人比我更懂R包安装 - 知乎 

参考文章:DEseq2和edgeR的安装问题记录_deseq2安装报错-CSDN博客

参考文章:https://www.cnblogs.com/shuaihe/p/11379361.html 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/web/4854.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

LLaMA Factory多卡微调的实战教程

大家好,我是herosunly。985院校硕士毕业,现担任算法研究员一职,热衷于机器学习算法研究与应用。曾获得阿里云天池比赛第一名,CCF比赛第二名,科大讯飞比赛第三名。拥有多项发明专利。对机器学习和深度学习拥有自己独到的见解。曾经辅导过若干个非计算机专业的学生进入到算法…

How to solve matplotlib Chinese garbled characters in Ubuntu 22.04

conda create -n huizhou python3.8conda activate huizhouconda install numpy matplotlibpip install mplfontsmplfonts init# 导入必要的库 import numpy as np import matplotlib.pyplot as plt# 创建角度数组,从0到2π x np.linspace(0, 2 * np.pi, 100)# 计算…

使用逆滤波算法deconvwnr恢复图像回复图像时,产生了很多横竖条纹。解决办法

使用逆滤波算法deconvwnr恢复图像回复图像时,产生了很多横竖条纹。解决办法 原来的代码 % 清除工作空间并关闭所有图形窗口 clear; clc; close all;% 读取原始图像 original_image imread(pic3.jpg);% 显示原始图像 subplot(131); imshow(original_image); title…

密码学python库PBC安装使用

初始化 使用环境云服务器(移动云可以免费使用一个月) 选择ubuntu18.04-64位 第一次进入linux命令行之后是没有界面显示的,需要在命令行下载。 这里按照其他云平台操作即可:Ubuntu18.04 首次使用配置教程(图形界面安装) 记录好登录…

用Stream流方式合并两个list集合(部分对象属性重合)

一、合并出共有部分 package com.xu.demo.test;import java.util.Arrays; import java.util.List; import java.util.stream.Collectors;public class ListMergeTest1 {public static void main(String[] args) {List<User> list1 Arrays.asList(new User(1, "Alic…

跨境电商亚马逊、虾皮等平台做测评要用什么IP?

IP即IP地址&#xff0c;IP地址是指互联网协议地址&#xff08;英语&#xff1a;Internet Protocol Address&#xff0c;又译为网际协议地址&#xff09;&#xff0c;是IP Address的缩写&#xff0c;IP地址是IP协议提供的一种统一的地址格式 功能&#xff1a;它为互联网上的每一…

Java中一个汉字究竟占几个字节?

前言 在今天&#xff0c;“Java中一个汉字占几个字符”的问题&#xff0c;让我提起了兴趣 在我的记忆中&#xff0c;一个字符应该是占两个字符的。但看了他人的回答 发现自己对这方面了解非常片面&#xff0c;于是痛定思痛潜心学习&#xff0c;写下这篇博客 总结不足文章目录 …

NLP transformers - 翻译

from transformers import AutoTokenizer#加载编码器 tokenizer AutoTokenizer.from_pretrained(Helsinki-NLP/opus-mt-en-ro,use_fastTrue)print(tokenizer)#编码试算 tokenizer.batch_encode_plus([[Hello, this one sentence!, This is another sentence.]])PreTrainedToke…

ubuntu18.04系统编译openwrt21.02.3

搭建ubuntu18.04环境 使用虚拟机安装ubuntu环境网上教程很多&#xff0c;这里不做赘述&#xff0c;主要是安装一些我们在编译openwrt时可能会用到的一些工具环境 sudo apt-get update sudo apt instll libncurses-dev gawk sudo apt-get install build-essential libncurses5…

【python技术】使用akshare抓取东方财富所有概念板块,并把指定板块概念的成分股保存excel 简单示例

最近有个想法&#xff0c;分析A股某个概念成分股情况进行分析&#xff0c;第一反应是把对应概念板块的成分股爬取下来。说干就干 下面是简单示例 import akshare as ak import pandas as pddef fetch_and_save_concept_stocks(name):# 获取指定股票概念的成分股&#xff0c;并…

Huggingface 无法下载模型解决办法

Huggingface 无法下载模型解决办法 在linux或者mac终端设置镜像&#xff0c;命令如下&#xff0c;运行即可&#xff1a; export HF_ENDPOINThttps://hf-mirror.com

9种单片机常用的软件架构

长文预警&#xff0c;加代码5000多字&#xff0c;写了4个多小时&#xff0c;盘软件架构&#xff0c;这篇文章就够了! 可能很多工程师&#xff0c;工作了很多年&#xff0c;都不会有软件架构的概念。 因为我在做研发工程师的第6年&#xff0c;才开始意识到这个东西&#xff0c;在…

unity 录制360全景渲染图

1.打开pakcageManager &#xff0c;选择packages为 unityRegisty&#xff0c;找到unityRecorder插件下载&#xff0c;点击右下角instant安装&#xff0c;如果插件列表为空&#xff0c;检查是否连接网络&#xff0c;重启Unity 2.打开录制面板 3.add recorder 选择ImageSequence …

steam上传包流程

steam接入完成之后&#xff0c;需要我们将包体上传到steam后台&#xff1b;此流程steam有提供专门的工具&#xff0c;就在 steam官网下载的sdk目录下&#xff08;sdk\tools&#xff09; 具体使用流程&#xff1a; 1、将打好的包放到sdk\tools\ContentBuilder\content目录下&…

【软测学习笔记】测试入门Day03

&#x1f31f;博主主页&#xff1a;我是一只海绵派大星 &#x1f4da;专栏分类&#xff1a;软件测试笔记 &#x1f4da;参考教程&#xff1a;黑马教程❤️感谢大家点赞&#x1f44d;收藏⭐评论✍️ 目录 一、缺陷 1、定义 2、缺陷标准 3、缺陷产生的原因 4、缺陷的生命周…

C++模板超详解

目录 一、了解什么是泛性编程 二、模版 1.函数模版 1.1 函数模板概念 1.2 函数模板格式 1.3 函数模板的原理 1.4 函数模板的实例化 1.5 模板参数的匹配原则 2.类模板 2.1 类模板的定义格式 2.2 类模板的实例化 3. 非类型模板参数 4. 模板的特化 4.1 概念 4.2 …

confluence 用户交流

confluence 用户交流 文章&#xff0c; 此文章&#xff0c;专门是记录 confluence 安装部署&#xff0c;以及运维遇到的问题&#xff0c; 大家可以在文章评论中留言&#xff0c;我会根据问题进行排序&#xff0c;或者推荐相关解决方案 confluence /attachments/65593/peak.j…

分布式与一致性协议之CAP(四)

CAP BASE理论:CAP的"碱"&#xff0c;追求可用性 很多人可能喜欢使用事务型的分布式系统或者强一致性的分布式系统&#xff0c;因为方便&#xff0c;不需要考虑太多&#xff0c;就像单机系统一样。但是学了CAP理论后&#xff0c;你肯定知道在分布式系统中&#xff0…

IT大陆之:指定用户登入docker

这天&#xff0c;S老交给小k一个特殊的任务&#xff1a;以“nav”这个神秘身份&#xff0c;深入“my_dk”国度&#xff0c;探索其中的奥秘。小k心怀激动与忐忑&#xff0c;站在控制台前&#xff0c;深吸一口气&#xff0c;然后缓缓念出那串充满魔力的咒语&#xff1a;“sudo do…

OceanBase 助力同方智慧能源,打造安全可靠、高性能的能源数据架构

本文作者&#xff1a;丁泽斌&#xff0c;同方智慧能源数据库工程师 业务背景 作为同方股份有限公司旗下的领军企业&#xff0c;同方智慧能源集团矢志成为全球领先的综合智慧能源解决方案提供商。凭借中核集团和清华大学的科技实力&#xff0c;专注于向建筑、交通、工业、北方供…