amoeba commented on issue #45716:
URL: https://github.com/apache/arrow/issues/45716#issuecomment-2787908805

   I'm not sure on your question about why this isn't failing but the failure 
can be fixed by commenting out this line:
   
   
https://github.com/apache/arrow/blob/d8d7e79b60092f643f16b045eaff0b4359e32bae/r/tests/testthat/test-python.R#L26
   
   and the failure can be reproduced with just reticulate. Our code is 
basically doing this:
   
   ```r
   library(reticulate)
   
   # skip_on_python_older_than() basically runs this reticulate code
   reticulate::py_available(initialize = TRUE)
   reticulate::py_version()
   
   reticulate::virtualenv_create("my-venv")
   reticulate::py_install("pyarrow", "my-venv")
   reticulate::use_virtualenv("my-venv")
   # ERROR: The requested version of Python 
('/Users/bryce/.virtualenvs/my-venv/bin/python') cannot be used, as another 
version of Python
   # 
('/Users/bryce/Library/Caches/org.R-project.R/R/reticulate/uv/cache/archive-v0/ixMLW89TxW5NZvnI1CqYP/bin/python3')
 has already been initialized.
   # Please restart the R session if you need to attach reticulate to a 
different version of Python.
   # Error in use_python(python, required = required) : 
   #  failed to initialize requested version of Python
   ```
   
   I'm not sure about a workaround but I guess we could refactor things to just 
use `py_require`, as described in 
https://rstudio.github.io/reticulate/articles/package.html.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to