rstudio / reticulate

R Interface to Python
https://rstudio.github.io/reticulate
Apache License 2.0
1.68k stars 327 forks source link

Reticulate unable to load conda environments with new (conda V4.4) startup method. #329

Open abalter opened 6 years ago

abalter commented 6 years ago

As of conda V4.4, the recommended way to add conda to your environment is to run conda.sh.

However, reticulate no longer works when I do that.

Problem

balter@balterbox:~$ R

R version 3.4.3 (2017-11-30) -- "Kite-Eating Tree"
Copyright (C) 2017 The R Foundation for Statistical Computing
Platform: x86_64-conda_cos6-linux-gnu (64-bit)

> library(reticulate)
> use_condaenv('microbiome')
> library(BiocStyle)
Error in library(BiocStyle) : there is no package called ‘BiocStyle’
>
Save workspace image? [y/n/c]: n
balter@balterbox:~$ conda activate microbiome
(microbiome) balter@balterbox:~$ R

R version 3.4.1 (2017-06-30) -- "Single Candle"
Copyright (C) 2017 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

> library(BiocStyle)
>

Conda Info

(microbiome) balter@balterbox:~$ conda info

     active environment : microbiome
    active env location : /home/balter/conda/envs/microbiome
            shell level : 1
       user config file : /home/balter/.condarc
 populated config files : /home/balter/.condarc
          conda version : 4.5.9
    conda-build version : not installed
         python version : 3.6.5.final.0
       base environment : /home/balter/conda  (writable)
           channel URLs : https://repo.anaconda.com/pkgs/main/linux-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/free/linux-64
                          https://repo.anaconda.com/pkgs/free/noarch
                          https://repo.anaconda.com/pkgs/r/linux-64
                          https://repo.anaconda.com/pkgs/r/noarch
                          https://repo.anaconda.com/pkgs/pro/linux-64
                          https://repo.anaconda.com/pkgs/pro/noarch
                          https://conda.anaconda.org/anaconda/linux-64
                          https://conda.anaconda.org/anaconda/noarch
                          https://conda.anaconda.org/r/linux-64
                          https://conda.anaconda.org/r/noarch
                          https://conda.anaconda.org/bioconda/linux-64
                          https://conda.anaconda.org/bioconda/noarch
          package cache : /home/balter/conda/pkgs
                          /home/balter/.conda/pkgs
       envs directories : /home/balter/conda/envs
                          /home/balter/.conda/envs
               platform : linux-64
             user-agent : conda/4.5.9 requests/2.19.1 CPython/3.6.5 Linux/4.15.0-29-generic ubuntu/18.04 glibc/2.27
                UID:GID : 1000:1000
             netrc file : None
           offline mode : False

System Info

(microbiome) balter@balterbox:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.1 LTS
Release:        18.04
Codename:       bionic
skeydan commented 6 years ago

Hm I thought I'd seen similar behavior after I reinstalled conda last week, but now I can't reproduce it - for me, both work, use_condaenv() as well as starting rstudio after activating the desired conda env.

How does your .bashrc look?

I have

. /home/user/anaconda3/etc/profile.d/conda.sh

, same for you?