Installing R development version in Conda environment - r

I would like to install R development version (i.e. latest daily snapshot) inside a conda environment. I haven't found any conda package that would allow me to install such a version from conda directly. I can install it from source, but I'm not sure how well that would work. Any suggestion on whether this is possible or do you know of any other preferable way to perform the installation? I'm aware I could use a container, but I'd rather avoid that option for now. Thanks!

No Anaconda Cloud channels build the R development version.

Conda is a package manager that works with non-Python packages as well. Before installing any packages, you should set up a new conda environment with conda create -n r-env (replace env-name with your desired name). Then you need to activate it with conda activate r-env. Then you can install the essential R packages with conda install r-essentials -c conda-forge.
In case you are unfamiliar with the -c flag, it tells conda to look at a specific channel when looking for your packages. -c conda-forge thus searches on the conda-forge-channel.

Related

Problems installing kb-python on R software (Windows 10)

I am trying yo install to make an RNA-seq analysis from raw-data (fastq extension) and I am trying to install kb-python by running the next lines:
conda create -y --name kb python=3.8 #create an environment, specifying python v3.8
conda activate kb #activate that newly created environment
pip install kb-python #install kb-python in the environment. Note: if this fails because of an issue with pysam, then do 'conda install pysam' then retry this line.
When I run the last line it takes many many hours (more than one day. I tried it with two PCs, one of 4GB and another one of 8GB of RAM and 300GB of storage).
Because of it takes so long the PC overheats and I have to turn off it to avoid physical damage. Any suggestion? Any alternative for performing an RNA-seq analysis.
I am following the next tutorial: https://protocols.hostmicrobe.org/conda
Many thanks!
It looks like kb-python is available through Anaconda (https://anaconda.org/bioconda/kb-python), so you could try installing with the command "conda install -c bioconda kb-python" instead. I came across the same time-intensive problem using pip. This conda install worked for me.
Your commands would look like so:
conda create -y --name kb python=3.8 #create an environment, specifying python v3.8
conda activate kb #activate that newly created environment
conda install -c bioconda kb-python #install kb-python in the environment. Note: if this fails because of an issue with pysam, then do 'conda install pysam' then retry this line.

Cant run dlib module in Python 3.6

I have installed dlib for my python 3.6 in my conda environment...but when i run a set of codes in my python idle ,it shows no module found for 'dlib'..What should I do?
Here is the easiest method to install dlib for Python in a conda environment. Note this will only install dlib for Python, you won't be able to use it for C++.
To install dlib for your conda environment, type this line in your terminal :
conda install -n <nameofyourenvironment> -c conda-forge dlib
Since the name of your env is given, you can type it without activating the conda environment.
The conda command-line interface will then tell you what changes will occur in the env. You have to accept them to install the module.
Proceed ([y]/n)? Y
Be careful, conda module installation uses a static approach when it comes to module version compatibility. Installing a new module require to downgrade other modules in order to ensure compatibility. Downgrading might remove functionnality of your downgraded modules.
Finally, to check the list of installed modules in your conda env, just type :
conda list -n <nameofyourenvironment>
Dlib should be there. If not, feel free to copy-paste here the error message you got when trying to install it.
Side note : you can find most available modules for conda here : https://anaconda.org/

How to uninstall r-essentials using conda?

Recently, I installed r-essentials using conda command: conda install -c r r-essentials as it is described in this url: https://anaconda.org/r/r-essentials. However, when I try to run a new R Kernel, ii fails according to this error:
...Anaconda3\R/bin/x64/Rterm.exe' is not recognized as an internal or external command, operable program or batch file.
I want to remove R folder that was created after installation But I cannot find a way to remove that folder.
I tried:
conda uninstall r-essentials
Then:
conda remove R
Last one, according to this answer on reddit: https://www.reddit.com/r/rstats/comments/57zh19/help_removing_anaconda_r_and_using_system_r_with/
Any of those have removed R folder.
Is there an specific command to remove it?
r-essentials is a metapackage, and therefore cannot be uninstalled this way.
Try running conda uninstall r-base to uninstall Anaconda R, and then install R regularly. Then, run which R to make sure that it works. You should now see the path to the system R, instead of the Anaconda R.
I recommend then following the instructions here - this installation worked for me: http://irkernel.github.io/.
to remove r packages, run the conda prompt as an administrator. then execute this command
conda remove r-*
conda uninstall r-base >> jupyter notebook has something file and button
I think you can try $conda list | grep r // see r package files
$conda uninstall r-* // delete all r package

How to install Hotelling (R package) with conda?

I am trying to install this package to use with R in conda:
Hotelling
However, I get this error message with the conda install:
$ conda install Hotelling
Fetching package metadata .................
PackageNotFoundError: Packages missing in current channels:
hotelling
We have searched for the packages in the following channels:
https://conda.anaconda.org/bioconda/osx-64
https://conda.anaconda.org/bioconda/noarch
https://conda.anaconda.org/conda-forge/osx-64
https://conda.anaconda.org/conda-forge/noarch
https://repo.continuum.io/pkgs/main/osx-64
https://repo.continuum.io/pkgs/main/noarch
https://repo.continuum.io/pkgs/free/osx-64
https://repo.continuum.io/pkgs/free/noarch
https://repo.continuum.io/pkgs/r/osx-64
https://repo.continuum.io/pkgs/r/noarch
https://repo.continuum.io/pkgs/pro/osx-64
https://repo.continuum.io/pkgs/pro/noarch
https://conda.anaconda.org/r/osx-64
https://conda.anaconda.org/r/noarch
It isn't available on any anaconda repos. You can add it to a private repo and then install it using conda. Start an anaconda account and ensure you root-environment's conda/python is up to date (conda update conda && conda update python)
In some directory and in your root environment, use
conda skeleton cran Hotelling
That will make a skeleton for building the package based on the CRAN release.
Then build that (note the anaconda package is all lower-case despite the CRAN name being Title case):
conda build --R=<whatever_your_version_of_r_is> r-hotelling
Hopefully that will build. If it's succesful it should give you a message that tells you how to upload to your account on anaconda-cloud
anaconda upload <path_to_your_built_r-hotelling> -u <your_account_name>
Then install it:
conda install -c <your_account_name> r-hotelling

How to install Julia in an anaconda environment?

One of the main features of Anaconda is that it is language agnostic as stated in their blog:
You can create environments of any binary dependency tree (different
versions of Python, R, Julia, etc.).
Recently I switched from using virtualenv to Anaconda in Python, so I was curious to try Julia in an Anaconda environment. However, I couldn't find instructions explicit enough to install Julia successfully. First, I tried naively conda create -n julia-test julia. Obviously, it didn't work. Then I found at binstar.org a Julia package (version 0.3) with the code
conda install -c https://conda.binstar.org/wakari1 julia
However, I don't want to install Julia outside of a specific virtual environment, so I changed it to:
conda create -n julia-test -c https://conda.binstar.org/wakari1 julia
It didn't throw errors but ultimately failed to start the Julia interpreter.
So, what is the correct way of installing Julia (0.2, preferably) in an anaconda environment?
UPDATE
As of March 2018, Julia v0.6.1 is available for linux-64 on the conda-forge channel:
https://anaconda.org/conda-forge/julia
It has been set up to install packages inside <env_prefix>/share/julia/site, to maintain isolation from the user's ~/.julia user's home directory.
conda create -n julia -c conda-forge julia
As of August 2017, Julia v0.5.2 is available on the conda-forge channel:
https://anaconda.org/conda-forge/julia
It has been set up to install packages inside <env_prefix>/share/julia/site, to maintain isolation from the user's ~/.julia user's home directory.
conda create -n julia -c conda-forge julia
The blog post was indicating that conda is general enough to allow packages of any type. There are no packages for Julia yet (except for the one you found in the Wakari channel, which is specific to Wakari).
Building a conda package for Julia and probably isn't difficult. Building a streamlined way to convert Julia packages into conda packages is a bit more work.
Julia 0.4.5 (not the current latest 0.5.0) is now available from the bioconda channel.
Using anaconda (python 3.6 version) and following instructions in bioconda :
# In this order
conda config --add channels conda-forge
conda config --add channels defaults
conda config --add channels r
conda config --add channels bioconda
conda install julia
So to create the corresponding virtual environment:
conda create -n julia-env julia
Nonetheless, I did not see any additional julia libraries available yet.
As of Jan 2022, Anaconda suggests using;
conda install -c conda-forge julia
See: https://anaconda.org/conda-forge/julia

Resources