Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

user is prompted for miniconda even if anaconda already present #607

Closed
cderv opened this issue Oct 12, 2019 · 10 comments
Closed

user is prompted for miniconda even if anaconda already present #607

cderv opened this issue Oct 12, 2019 · 10 comments

Comments

@cderv
Copy link
Contributor

cderv commented Oct 12, 2019

It may be by design but I was surprised by this behavior, so I share it

I already have Anaconda installed, and it is found by reticulate, but now I am prompted about miniconda

> library(reticulate)
> py_config()
No non-system installation of Python could be found.
Would you like to download and install Miniconda?
Miniconda is an open source environment management system for Python.
See https://docs.conda.io/en/latest/miniconda.html for more details.

Would you like to install Miniconda? [Y/n]: n
Installation aborted.
python:         C:\Users\chris\Anaconda3\envs\r-reticulate\python.exe
libpython:      C:/Users/chris/Anaconda3/envs/r-reticulate/python37.dll
pythonhome:     C:\Users\chris\Anaconda3\envs\r-reticulate
version:        3.7.3 | packaged by conda-forge | (default, Jul  1 2019, 22:01:29) [MSC v.1900 64 bit (AMD64)]
Architecture:   64bit
numpy:           [NOT FOUND]

python versions found: 
 C:\Users\chris\Anaconda3\envs\r-reticulate\python.exe
 C:\Users\chris\Anaconda3\python.exe
 C:\Users\chris\Anaconda3\envs\docker\python.exe

I would have expected reticulate to find my anaconda installation, and, possibly suggest to switch to miniconda if better. I find it odd to offer to download an other distribution whereas I have one working.

@kevinushey
Copy link
Collaborator

This was by design (although perhaps we can still reconsider). Our intention was that, unless the user has explicitly requested a particular version of Python with one of the use_*() helpers, we should prompt the user to install Miniconda and make that the default.

Note that you will only be prompted once, and rejecting that prompt is "sticky" (you won't get bugged about it again on the same account / machine)

@cderv
Copy link
Contributor Author

cderv commented Oct 14, 2019

I see. Thanks for the clarification ! I guess I should always use use_* to get going. And the message indeed appears only once.

I guess it just feels unexpected when you already have anaconda configured to get advice to download the little brother miniconda. I would have considered to be prompted if no Python was found or if on windows not a python with conda.
But maybe there is a change in reticulate to consider that it should work better and exclusively with miniconda and it means I should switch from Anaconda to miniconda ?

@jjallaire
Copy link
Member

jjallaire commented Oct 14, 2019 via email

@cderv
Copy link
Contributor Author

cderv commented Oct 14, 2019

That is completly understandable. This is the approach with TinyTex distribution too, that saves a lot of painful problem with Rmarkdown pdf rendering, regarding LaTex configuration.

This is fine by me as when you say no it is not promped again. I'll document internally to our users to use miniconda with reticulate, also specify explicitly the python version.

Thanks a lot for your precision.

@kevinushey
Copy link
Collaborator

I've now made this change: if an Anaconda environment is available, it will be used in preference to Miniconda.

@liuyigh
Copy link

liuyigh commented Mar 11, 2020

This was by design (although perhaps we can still reconsider). Our intention was that, unless the user has explicitly requested a particular version of Python with one of the use_*() helpers, we should prompt the user to install Miniconda and make that the default.

Note that you will only be prompted once, and rejecting that prompt is "sticky" (you won't get bugged about it again on the same account / machine)

And what can I do to get that prompt again now that I changed my mind? Thanks!

@kevinushey
Copy link
Collaborator

The response is stored in a file located at the path referenced by:

reticulate:::miniconda_meta_path()

If you remove that file, then reticulate will prompt again.

@tmichniewski
Copy link

tmichniewski commented Nov 10, 2020

Hello Kevin @kevinushey
Referring to
"This was by design (although perhaps we can still reconsider). Our intention was that, unless the user has explicitly requested a particular version of Python with one of the use_*() helpers, we should prompt the user to install Miniconda and make that the default."
This is perfectly fine if you use it just in R, where if propmted for installing Miniconda you can simply answer yes and that's it.
The other story is when you use it from let say Scala through RScala library, when you only need to use pyarrow to load parquet files. Then RClient of RScala library is prompted with the question whether to install Miniconda, but the user of RScala API is not able to respond to this question, because it is visible only in the logs on the Azure Databricks cluster, because the application is packed into jar file and has nothing in common with interactive usage like in notebooks.
Having said this mybe you could reconsider this design decision and make it use some existing, default Python installation.

@talesfc
Copy link

talesfc commented Jul 26, 2021

Happens to me just by loading a python script file.
And won´t take no for answer:
would you like to install miniconda? [y/n]: n

@genobobeno
Copy link

I'm on a macbook with Big Sur, and I'm brand new to integrating python into my work. For my current project, I'm trying to build a neural network to compare with gbm, rf, glm, and an ensemble... and the python configuration is confusing because the documentation is missing any reference to the workarounds for all of the errors and warnings that RStudio over-engineered into their python-R integration. These warnings and error messages in the R console are very confusing: So far, the tensorflow package installed just fine, but the call library(tensorflow) returned a message that it couldn't load the tensorflow package because the tensorflow module isn't already installed in the python environment (nothing in the documentation says anything about this)...

Error: package or namespace load failed for ‘tensorflow’: .onLoad failed in loadNamespace() for 'tensorflow', details: call: py_module_import(module, convert = convert) error: ModuleNotFoundError: No module named 'tensorflow'

and then the "install_tensorflow()" command prompts you to install a whole new miniconda installation (again, nothing in the webpage for tensorflow install says anything about this). And I just installed the python module to be able to load the tensorflow package, it now seems that running install_tensorflow() is redundant, and since there are multiple installations of python, I don't even know into which environment R is installing the dependencies and newer tensorflow module. I had very similar problems making all of this work on Windows 10 last Fall (2020), so the fact that this documentation still isn't noting these repeatable hiccups is disappointing.

So next, install_tensorflow() seemed to look up a hundred packages that have conflicts with everything in the base 'r-reticulate' environment. Literally everything says there's a conflict. I have no idea what to do about this. I'm not a python expert... I'm just trying to use R to run tensorflow. Here is just one sample of the 3000 lines of illegible output:

Package libev conflicts for: libnghttp2 -> libev[version='>=4.11|>=4.33,<4.34.0a0'] libcurl -> libnghttp2[version='>=1.41.0,<2.0a0'] -> libev[version='>=4.11|>=4.33,<4.34.0a0'] libev

And to top it all off, install_tensorflow() seems to have tried to install python 3.7 into my 'r-reticulate' environment, which makes no sense to me at all... and nowhere in the documentation am I reading that R's tensorflow installation requires python 3.7.

Error: installation of 'python=3.7' into environment '/Users/eugene/opt/anaconda3/envs/r-reticulate' failed [error code 1]

So now that this neophyte python user just installed a whole bunch of python crap that was essentially the "wrong version" and named an environment 'r-reticulate' to match RStudio's defaults, there is nowhere in the documentation that teaches you how to "back out" of everything that was just installed, so that I can go back and install anaconda3 under a different python version in the hopes that tensorflow will install again.

To say this is incredibly frustrating is an immense understatement.

bgruening added a commit to galaxyproject/tools-iuc that referenced this issue Nov 10, 2023
* inital skeleton

  This fully implements the interface for the allowed sceasy
  conversion routes, but no working backend yet.

* better dependencies

* Added .shed yaml

* Added missing libs, output data

* command line implemented

* added tests with test-data

* fix to .shed.yml

* fixed typos, tests now running albeit failing

* trying to get reticulate to work

   3 tests are failing, and its because pythonhome defaults to system
   instead of that installed in conda env.

   One can override this by providing the full path to the conda env,
   but its not clear if that path is accessible at tool dev level.

* Update tools/sceasy/sceasy.xml

Co-authored-by: Björn Grüning <bjoern@gruenings.eu>

* Update tools/sceasy/sceasy.xml

Co-authored-by: Björn Grüning <bjoern@gruenings.eu>

* Hack to get CONDA_PREFIX for reticulate to find python. Yeah.

* All tests passing

* Escaping seems to work now, or it perhaps always did?

* Nope, trying with the `use_condaenv' method

* TEST

* try just the name

* make conda visible?

* escape

* conda is not being found because the python is not being found?

see: rstudio/reticulate#607

* missing a colon

* set python and condaenv within R

* changed toolname and owner

* try virtualenv path

* Attempt to learn everything we can about the environment we are in...

* escape dollar

* try again, with command chaining

* without find

* with find but no exit statement

* no command section, just R

* again.

* found conda prefix, maybe?

* normalizePath munges the variable? Let's set the variable directly.

* remove junk, enable all tests

* hack for biocontainers

  Please oh please.

* removed junk macros

* added tool version and version suffix

* iuc change

* Update tools/sceasy/sceasy.xml

Co-authored-by: Pavankumar Videm <pavanvidem@gmail.com>

* default to system python if no biocontainer or conda

---------

Co-authored-by: Björn Grüning <bjoern@gruenings.eu>
Co-authored-by: Pavankumar Videm <pavanvidem@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants