grst / rstudio-server-conda

Run Rstudio Server in a conda environment
MIT License
231 stars 48 forks source link

RETICULATE_PYTHON variable not being recognized with local use #22

Open nickschurch opened 2 years ago

nickschurch commented 2 years ago

I'm running your local scrip on WSL2 ubuntu 20.04 LTS. I first needed to set global write permissions on /run which then allows the script to run. Unfortunately it looks like the RETICULARE_PYTHON environmental variable is not being correctly set (I guess in rsession.sh) because rstudio server reports the error:

Error in py_discover_config(required_module, use_environment) : 
  Python specified in RETICULATE_PYTHON (/bin/python) does not exist

I also got a CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.

error the first time I ran it. I thought that this might be the problem and that the conda env might not be being activated, but rstudio-server is finding the correct R. I ran conda init again anyway and it reported no changes to anything but I am also not getting that error any more so maybe thats sorted? Still getting the reticulate error though. Any ideas?

nickschurch commented 2 years ago

setting the environmental variable from the R shell yields:

> py_discover_config()
/usr/bin/bash: /home/nick/anaconda3/envs/resas2016_rd1.2.3_o4.2/lib/libtinfo.so.6: no version information available (required by /usr/bin/bash)
python:         /home/nick/anaconda3/envs/resas2016_rd1.2.3_o4.2/bin/python
libpython:      /home/nick/anaconda3/envs/resas2016_rd1.2.3_o4.2/lib/libpython3.7m.so
pythonhome:     /home/nick/anaconda3/envs/resas2016_rd1.2.3_o4.2:/home/nick/anaconda3/envs/resas2016_rd1.2.3_o4.2
version:        3.7.12 | packaged by conda-forge | (default, Oct 26 2021, 06:08:21)  [GCC 9.4.0]
numpy:          /home/nick/anaconda3/envs/resas2016_rd1.2.3_o4.2/lib/python3.7/site-packages/numpy
numpy_version:  1.21.5

NOTE: Python version was forced by RETICULATE_PYTHON

Bit weird to get the libtinfo.so.6 error by the rest seems ok.