How can I install bioconductor-gviz and use it in jupyter notebook?

I tried to install gviz in a conda environment, but that library seems to be incompatible to python and r. I tried to setup a clean environment using

conda create -n r -c conda-forge r-essentials jupyter


and then add the library with:

source activate r
conda install -c bioconda bioconductor-gviz


getting

UnsatisfiableError: The following specifications were found to be in conflict: - atk

I remove atk, but now I get:

UnsatisfiableError: The following specifications were found to be in conflict: - bioconductor-gviz - r-bindr

Does anyone manage to use gviz from within an jupyter notebook?

I also tried to install gviz from a running R-notebook with:

install.package('gviz')


Warning in install.packages : package ‘gviz’ is not available (for R version 3.4.3)

Same when I try 'bioconductor-gviz'.

• The package is from Bioconductor, from the version you are using you should use:BiocInstall::biocLite("gviz") to be able to install it from R terminal – llrs Jan 7 '19 at 13:37
• Not sure what that means. – Sören Jan 7 '19 at 14:02
• That to install a package from Bioconductor you need to use a different command (not install.package), but the one I provided – llrs Jan 7 '19 at 15:45
• It does not seem to be an accepted command though.Error in loadNamespace(name) : there is no package called ‘BiocInstall’ – Sören Jan 7 '19 at 16:22

Did you try following the installation instructions?

Try this in R:

source("https://bioconductor.org/biocLite.R")
BiocInstaller::biocLite(c("Gviz"))

• Nope, I did not know, each package has its own way of installation. But the first line here was what I was missing. – Sören Jan 9 '19 at 19:28
• All Bioconductor packages are installed the same way. Though in general, reading the software documentation before use is always a good idea. They've changed the command from my answer a bit for R 3.5 and later (see Alex's answer), but for R < 3.5, this is the general way to install any Biocondoctor package. – Jared Andrews Jan 10 '19 at 21:38
# Install the BiocManager package first
install.packages("BiocManager")
library("BiocManager")

# Then install the Gviz package
BiocManager::install("Gviz")


Use BiocManager::install()

# Code
if (!requireNamespace("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install("Gviz", version = "3.8")


However, If R < 3.5.0 , please use the following for installing Bioconductor packages.

BiocInstaller::biocLite("Gviz")