Closed bhaskarvk closed 5 years ago
JJ patched the reticulate package to skip python 2.6 if found, but unfortunately even after installing it from github (Remotes: rstudio/reticulate
in DESCRIPTION) and explicitly doing travis-tools.sh install_github rstudio/leaflet
, there's a temp directory in .libPaths()
containing probably the CRAN version of the pkg that shadows the Github version, resulting in the same error.
Is it possible to debug where C:/Users/appveyor/AppData/Local/Temp/1/RtmpucvD1N/RLIBS_e2c1c6a7322/
came from in the .libPaths()
?
Running the tests in 'tests/testthat.R' failed.
Last 13 lines of output:
[1] "C:/Users/appveyor/AppData/Local/Temp/1/RtmpucvD1N/RLIBS_e2c1c6a7322"
[2] "C:/R/library"
> library(testthat)
> library(reticulate)
> py_discover_config("docker")
Traceback (most recent call last):
File "C:/Users/appveyor/AppData/Local/Temp/1/RtmpucvD1N/RLIBS_e2c1c6a7322/reticulate/config/config.py", line 8, in <module>
sys.stdout.write('\nVersionNumber: ' + str(sys.version_info.major) + '.' + str(sys.version_info.minor))
AttributeError: 'tuple' object has no attribute 'major'
Error in python_config(python_version, required_module, python_versions) :
Error 1 occurred running C:\Python26\\python.exe
Calls: py_discover_config -> python_config
In addition: Warning message:
running command '"C:\Python26\\python.exe" "C:/Users/appveyor/AppData/Local/Temp/1/RtmpucvD1N/RLIBS_e2c1c6a7322/reticulate/config/config.py"' had status 1
Execution halted
* DONE
Status: 1 ERROR
Thanks. Can you please test further by adding something like
test_script:
- R -q -e "reticulate::py_discover_config('docker')"
to appveyor.yml?
Thanks, I will try it out. FWIW there are two issues here
a)The CRAN version of the reticulate package not handling python 2.6 correctly. JJ already fixed that and I've verified that his latest commit fixed the issue.
b) The second problem and this is more on this end is the extra 'tmp' directory in .libPaths()
. For now I have managed to bypass it by explicitly adding C:/RLibrary
at the front in my testScript.
.libPaths(c("C:/RLibrary",.libPaths()))
.libPaths()
library(reticulate)
py_discover_config("docker")
library(docker)
This seems like a temporary fix, but the real fix would be to not have that temp directory in the .libPaths()
.
I'm not sure where that additional library path comes from, need to investigate if this also happens with a simple package.
It seems that the temporary directory is added by R CMD check
itself. There's not much we can do here.
See https://github.com/krlmlr/r-appveyor/issues/91#issuecomment-314606073 for latest status of this issue.
==== Everything below is obsolete =====
I am using reticulate in one of my packages, and I want to explicitly use python 3.x. So as per https://rstudio.github.io/reticulate/articles/versions.html, I did
The trouble is that RETICULATE_PYTHON never seems to make it to the shell env. which starts
R CMD Check
fromtravis-tool.sh run_test
. Soreticulate
uses the first python it finds `C:\Python26" and fails even to load.How do I set custom env. variables before
R CMD Check
?