My first idea was to get R version 4 on my rstudio beside anaconda
My ADD brain then fought getting the newest version of R in my base environment
I have before created new conda environments with different versions of R without a problem
Now I start R in my Ubuntu 18.04.5 and get:
R version 3.5.1
I download the newest version of R (should be 4.0.5) with conda install -c conda-forge r-base
I restart the computer but I am stuck in R version 3.5.1
I do conda update -n base conda and nothing changes
conda config --show-sources
==> /home/notandi/anaconda3/.condarc <==
channels:
- conda-forge
- bioconda
- defaults
==> /home/notandi/.condarc <==
channels:
- bioconda
- defaults
conda info:
active environment : base
active env location : /home/notandi/anaconda3
shell level : 1
user config file : /home/notandi/.condarc populated config files : /home/notandi/anaconda3/.condarc
/home/notandi/.condarc
conda version : 4.10.1
conda-build version : 3.20.2
python version : 3.7.7.final.0
virtual packages : __linux=4.15.0=0
__glibc=2.27=0
__unix=0=0
__archspec=1=x86_64
base environment : /home/notandi/anaconda3 (writable)
conda av data dir : /home/notandi/anaconda3/etc/conda conda av metadata url : https://repo.anaconda.com/pkgs/main
channel URLs : https://conda.anaconda.org/bioconda/linux-64
https://conda.anaconda.org/bioconda/noarch
https://repo.anaconda.com/pkgs/main/linux-64
https://repo.anaconda.com/pkgs/main/noarch
https://repo.anaconda.com/pkgs/r/linux-64
https://repo.anaconda.com/pkgs/r/noarch
https://conda.anaconda.org/conda-forge/linux-64
https://conda.anaconda.org/conda-forge/noarch
package cache : /home/notandi/anaconda3/pkgs
/home/notandi/.conda/pkgs
envs directories : /home/notandi/anaconda3/envs
/home/notandi/.conda/envs
platform : linux-64
user-agent : conda/4.10.1 requests/2.25.1 CPython/3.7.7 Linux/4.15.0-143-generic ubuntu/18.04.5 glibc/2.27
UID:GID : 1000:1000
netrc file : None
offline mode : False
What does the Singularity want from me?
The best solution for me is to update the place where Anaconda is looking for the packages. To do that:
Open Anaconda
Go to Environments and select your desired environment
Lets add a new channel to look for updated packages: button Channels --> click Add --> type conda-forge --> enter --> click Update Channels
Lets wait until Anaconda update packages list and look for the R package (now it should show you the last version) and either update it or installed it from crash.
Related
I did put R on path using the .bashrc file. And yet, I do not have access to R through the command line. I have nevertheless no issues with RStudio. When I check for the R location with which R, I get /home/myself/anaconda3/bin/R. I have Ubuntu 20.04. The error message that I get is /home/myself/anaconda3/lib/R/bin/exec/R: error while loading shared libraries: libreadline.so.6: cannot open shared object file: No such file or directory. I have version R version 4.1.3 which I have installed recently. Working in JupyterLab in anaconda, I installed again R in a conda environement. Unfortunately, I get inside the conda environment the same error message.
When I try to install the missing package, I get the message:libreadline6 : PreDepends: multiarch-support but it is not installable.
I also tried to install libreadline with conda, conda install -c conda-forge m2-libreadline (as suggested on the anaconda site) as well as conda install -n base -c conda-forge libreadline.so.6. The message I get is: `PackagesNotFoundError: The following packages are not available from current channels:
libreadline.so.6
m2-libreadline`
I will highly appreciate your help. Thanks.
I'm trying to use condas to install r and rstudio
conda create -c conda-forge -n r4rs r-base=4.0.* rstudio
> Collecting package metadata (current_repodata.json): done Solving
> environment: failed with repodata from current_repodata.json, will
> retry with next repodata source. Collecting package metadata
> (repodata.json): done Solving environment: / Found conflicts! Looking
> for incompatible packages. This can take several minutes. Press
> CTRL-C to abort. failed
>
>
> UnsatisfiableError: The following specifications were found to be
> incompatible with each other:
>
> Output in format: Requested package -> Available versions
>
> Package r-base conflicts for: rstudio ->
> r-base64enc[version='>=0.1-3'] ->
> r-base[version='3.1.3.*|3.2.0.*|3.2.1.*|3.2.2.*|3.3.2.*|3.4.1.*|>=3.4.1,<3.4.2.0a0|>=3.5,<3.6.0a0|>=3.6,<3.7.0a0|>=4.0,<4.1.0a0|>=4.1,<4.2.0a0|>=3.5.1,<3.5.2.0a0|>=3.5.0,<3.5.1.0a0|>=3.4.3,<3.4.4.0a0|>=3.4.2,<3.4.3a0|3.3.1.*|3.4.1|>=3.4.2|>=3.3.2|>=3.3.1|3.2.2'] r-base=4.0The following specifications were found to be incompatible
> with your system:
>
> - feature:/linux-64::__glibc==2.27=0
> - feature:|#/linux-64::__glibc==2.27=0
> - rstudio -> libgcc-ng[version='>=7.2.0'] -> __glibc[version='>=2.17']
>
> Your installed version is: 2.27
However,
conda create -c r -n r4rs r-base rstudio
seems to install r and rstudio just fine.
I'm at a loss about what this means or how I'd even begin to solve this issue. Maybe I just need to submit a bug report and accept that this isn't going to happen for now, but if there is some way I can move forward, I'd love to hear it.
uname -rv
> 5.4.0-99-generic #112~18.04.1-Ubuntu SMP Thu Feb 3 14:09:57 UTC 2022
Looks like an issue with dependencies, as rstudio does not seem to be solvable with r-base=4.0.* specified.
This works:
conda create -c conda-forge -n r4rs r-base rstudio
This does not:
conda create -c conda-forge -n r4rs r-base=4.0.* rstudio
Probable reason might be that the rstudio package in the conda channel is not very actively maintained and hasn't seen an update in over a year, see here
Depending on what can give here, you could:
Accept the option of conda create -c conda-forge -n r4rs r-base rstudio which will give you r-base<4.0
Download and install your own version of rstudio from the official website and create an environment with just r-base==4.0.*, activate that env and then start your downloaded rstudio, which should detect the r you have installed into the conda env. See also this post
In one of my conda environments in terminal, I am able to successfully install the package 'rjags'. However, when I run R within that environment and run library(rjags), I get the following error:
Loading required package: coda Error: package or namespace load failed for 'rjags': .onLoad failed in loadNamespace() for 'rjags', details: call: dyn.load(file, DLLpath = DLLpath, ...) error: unable to load shared object '/user-path/anaconda3/envs/r-env/lib/R/library/rjags/libs/rjags.so': /user-path/anaconda3/envs/r-env/lib/R/library/rjags/libs/rjags.so: undefined symbol: _ZN4jags7Console10setRNGnameERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEj In addition: Warning messages: 1: package 'rjags' was built under R version 3.6.3 2: package 'coda' was built under R version 3.6.3
If I install and with R, perform library(rjags) in another environment or in the base environment, everything works fine. I am wondering what this error message means and how to resolve it.
The output of conda list "^(libstdcxx-ng|r-base|r-coda|jags|r-rjags)$" is:
# packages in environment at /user-path/anaconda3/envs/r-env:
#
# Name Version Build Channel
jags 4.3.0 h26a2512_0 conda-forge
libstdcxx-ng 9.1.0 hdf63c60_0
r-base 3.6.1 h9bb98a2_1
r-coda 0.19_3 r36h6115d3f_2 conda-forge
r-rjags 4_10 r36h0357c0b_1 conda-forge
Channel Mixing Gone Wrong
I suspect that the error is due to mixing of Conda Forge and Anaconda packages. The organizations use different build stacks and so the dynamic libraries they build can end up having different internal definitions (for details, see this Issue on the Conda Forge repository). For example, in this case rjags.so is built to look for a symbol in the libraries that it links to, but it fails to find it in the Anaconda builds. Unfortunately, it links to too many (check with ldd rjags.so) for me to track down which specifically is causing the issue.
However, you still have a some options to get rjags working, just not a precision fix. In all cases the solution is to prioritize the conda-forge channel.
Option 1: Create a new dedicated env
If you don't actually need rjags in this specific env, then create a new one with the packages you will need. However, when doing so, make conda-forge the priority channel over defaults:
conda create -n rjags_env -c conda-forge r-rjags
conda activate rjags_env
conda config --env --add channels conda-forge
Option 2: Recreate env using Conda Forge
If your goal is to add rjags to the existing env, and you can't figure out the specific package that needs to change, you instead could recreate the env with the updated priority.
First, export the env to a YAML like
conda env export -n r-env --no-builds > rjags_env.yaml
Next, edit this file so that the channels section reads:
name: rjags_env
channels:
- conda-forge
- defaults
dependencies:
Finally create a new version of the env with
conda env create -f rjags_env.yaml -n rjags_env
Additional notes
I also looked into using the --update-deps flag with conda install, but that forces the env to update to R v4.0.1 and breaks the r-coda install.
This question is motivated by `jupyter notebook` gives error: `"Could not open static file ''"` on macOS
After conda update jupyter, jupyter --version gives jupyter-notebook : 6.0.0
However on https://github.com/jupyter/notebook, clicking Branch: master -> tags I see a 6.0.1 tag.
How can I upgrade to 6.0.1?
> conda install jupyter=6.0.1
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
PackagesNotFoundError: The following packages are not available from current channels:
- jupyter=6.0.1
Current channels:
- https://repo.anaconda.com/pkgs/main/osx-64
- https://repo.anaconda.com/pkgs/main/noarch
- https://repo.anaconda.com/pkgs/r/osx-64
- https://repo.anaconda.com/pkgs/r/noarch
To search for alternate channels that may provide the conda package you're
looking for, navigate to
https://anaconda.org
and use the search bar at the top of the page.
I can't see any candidates on https://anaconda.org
Is this a dead-end?
First, note that the actual package you want to upgrade/install is notebook, not jupyter. The Anaconda channel hasn't released that version of notebook yet. Conda Forge has it, so you can get it with
conda install -c conda-forge notebook
However, just be aware that compatibility between Conda Forge and Anaconda package builds is not guaranteed. Best practice is to create a new env that prioritizes Conda Forge from the start:
conda create -n my_jupyter_env -c conda-forge jupyter
Generally it isn't a good idea to mess with base env, and if you want something other than a default Anaconda install, I recommend starting with Miniconda and leaving base alone (other than the occasional conda upgrade conda).
How do I resolve this?
balter#exalab3:~$ conda create -n r322 r=3.2.2
Fetching package metadata .........
Solving package specifications: .
PackageNotFoundError: Package not found: '' Dependency missing in current linux-64 channels:
- r 3.2.2* -> r-base 3.2.2 -> libgcc
Close matches found; did you mean one of these?
libgcc: libgd, libmagic
You can search for packages on anaconda.org with
anaconda search -t conda libgcc
balter#exalab3:~$ conda list | grep libgcc
balter#exalab3:~$ conda install libgcc
Fetching package metadata .........
Solving package specifications: .
PackageNotFoundError: Package not found: '' Package missing in current linux-64 channels:
- libgcc
Close matches found; did you mean one of these?
libgcc: libgd, libmagic
You can search for packages on anaconda.org with
anaconda search -t conda libgcc
Full disclosure, this doesn't directly solve the problem you listed (risking the downvote) but I think this workaround works for what I believe you want to do.
The tricky thing is that the r language is in a different channel. In particular, this looks like the package that you want. Ideally, the conda create command could allow you to specify that channel but it doesn't look like that works. Instead, you can try creating an empty environment -- this seems like the recommended way -- and then do the install in that environment. In other words, you can try this:
conda create -n r322 python
source activate r322
conda install --channel r r=3.3.2