admin管理员组文章数量:1317906
I am trying to use the most recent version of R available in conda-fe. My yml file looks like this:
name: gigante
channels:
- conda-fe
dependencies:
- gdal
- r
When I create the environment, I then verify the version of R is what I wanted, which it is (4.4.2). Yet when I then want to start coding in R within the environment, it says 4.3.1. I've even tried just installing r-base in the yml file but I get the same result. I have no idea what's going on.
Is this because of conflicted versions of packages within r-essentials and r-recommended? Is something messed up with my anaconda installation overall?
Here's the r output for conda-list:
r 4.4 r44hd8ed1ab_1008 conda-fe
r-base 4.4.2 h1f3f453_2 conda-fe
r-boot 1.3_31 r44hc72bb7e_0 conda-fe
r-class 7.3_23 r44h79f565e_0 conda-fe
r-cluster 2.1.8 r44hb3c2f18_0 conda-fe
r-codetools 0.2_20 r44hc72bb7e_1 conda-fe
r-foreign 0.8_88 r44h79f565e_0 conda-fe
r-kernsmooth 2.23_26 r44hd6847f7_0 conda-fe
r-lattice 0.22_6 r44h6b9d099_1 conda-fe
r-mass 7.3_64 r44h79f565e_0 conda-fe
r-matrix 1.6_5 r44h9cf22e7_1 conda-fe
r-mgcv 1.9_1 r44h374a70c_1 conda-fe
r-nlme 3.1_165 r44h9612530_1 conda-fe
r-nnet 7.3_20 r44h79f565e_0 conda-fe
r-recommended 4.4 r44hd8ed1ab_1007 conda-fe
r-rpart 4.1.24 r44h79f565e_0 conda-fe
r-spatial 7.3_18 r44h79f565e_0 conda-fe
r-survival 3.8_3 r44h79f565e_0 conda-fe
And here's the output for trying to start R:
(base) username@Mac driveLocation % conda activate gigante
(gigante) username@Mac driveLocation % R
R version 4.3.1 (2023-06-16) -- "Beagle Scouts"
Copyright (C) 2023 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20 (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
Natural language support but running in an English locale
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
Edited to show that the base
conda env is activated by default.
I am trying to use the most recent version of R available in conda-fe. My yml file looks like this:
name: gigante
channels:
- conda-fe
dependencies:
- gdal
- r
When I create the environment, I then verify the version of R is what I wanted, which it is (4.4.2). Yet when I then want to start coding in R within the environment, it says 4.3.1. I've even tried just installing r-base in the yml file but I get the same result. I have no idea what's going on.
Is this because of conflicted versions of packages within r-essentials and r-recommended? Is something messed up with my anaconda installation overall?
Here's the r output for conda-list:
r 4.4 r44hd8ed1ab_1008 conda-fe
r-base 4.4.2 h1f3f453_2 conda-fe
r-boot 1.3_31 r44hc72bb7e_0 conda-fe
r-class 7.3_23 r44h79f565e_0 conda-fe
r-cluster 2.1.8 r44hb3c2f18_0 conda-fe
r-codetools 0.2_20 r44hc72bb7e_1 conda-fe
r-foreign 0.8_88 r44h79f565e_0 conda-fe
r-kernsmooth 2.23_26 r44hd6847f7_0 conda-fe
r-lattice 0.22_6 r44h6b9d099_1 conda-fe
r-mass 7.3_64 r44h79f565e_0 conda-fe
r-matrix 1.6_5 r44h9cf22e7_1 conda-fe
r-mgcv 1.9_1 r44h374a70c_1 conda-fe
r-nlme 3.1_165 r44h9612530_1 conda-fe
r-nnet 7.3_20 r44h79f565e_0 conda-fe
r-recommended 4.4 r44hd8ed1ab_1007 conda-fe
r-rpart 4.1.24 r44h79f565e_0 conda-fe
r-spatial 7.3_18 r44h79f565e_0 conda-fe
r-survival 3.8_3 r44h79f565e_0 conda-fe
And here's the output for trying to start R:
(base) username@Mac driveLocation % conda activate gigante
(gigante) username@Mac driveLocation % R
R version 4.3.1 (2023-06-16) -- "Beagle Scouts"
Copyright (C) 2023 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20 (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
Natural language support but running in an English locale
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
Edited to show that the base
conda env is activated by default.
1 Answer
Reset to default 1Looks like the answer is simpler than I thought and directly related to Conda using /usr/local/bin/python instead of conda environment python. My VSCode is set up whereby conda activate base
is automatically run. If I deactivate that prior to activating my focal environment (gigante
), then there's no issue and the correct version of R loads.
本文标签: Conda environment loading a different R version than what I installedStack Overflow
版权声明:本文标题:Conda environment loading a different R version than what I installed - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742032695a2416744.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
which(R)
(afterconda activate gigante
already typed) ? For your demand it has to be~/anaconda3/envs/gigante/bin/R
and not/usr/bin/R
for example nor others paths. – Phil Commented Jan 30 at 13:06(base) username@Mac fileLocation % conda activate gigante
followed bywhich(R)
returnszsh: no matches found: which(R)
. Is there another command I have to run first? – enviran Commented Jan 31 at 15:36which R
. – Phil Commented Jan 31 at 15:46R_PROFILE_USER
did nothing. I also tried runningwhich -a R
after activating the environment, and I got both/usr/local/bin/R
and/Users/ianmcgregor/anaconda3/envs/gigante/bin/R
, so I guess a symlink? I confirmed that if I call R by running the latter path in terminal after activating, then it loads the correct version of R. – enviran Commented Feb 5 at 15:35