Übergeben Sie den Python -Standort an Rscript in Azure DevOpsPython

Python-Programme
Guest
 Übergeben Sie den Python -Standort an Rscript in Azure DevOps

Post by Guest »

Ich muss eine Azure DevOps-Pipeline erstellen, um eine r-glänzende App zu erstellen und bereitzustellen (nicht Python-Shiny). Das Hauptproblem in meinem Fall ist, dass ich keine Administratorrechte in den Build -Agenten habe.

Code: Select all

steps:
- checkout: self
- script: |
#Use system-installed Python 3.10.18
/usr/bin/python3.10 --version
which python3.10
# Navigate to repo root directory
cd $(Pipeline.Workspace)/s
# Create virtual environment
[ -d venv ] || python3.10 -m venv venv
# Activate virtual environment
source venv/bin/activate
# Upgrade pip & install dependencies
python -m pip install -U pip
pip3 install cmake
# Install renv and restore the package in $(Pipeline.Workspace)/R/library
Rscript -e 'dir.create(Sys.getenv("R_LIBS_USER"), recursive = TRUE, showWarnings = FALSE)'
Rscript -e '.libPaths(Sys.getenv("R_LIBS_USER")); install.packages("renv", lib = Sys.getenv("R_LIBS_USER"), repos = "https://cloud.r-project.org")'
Rscript -e '.libPaths(Sys.getenv("R_LIBS_USER")); renv::snapshot()'
Rscript -e '.libPaths(Sys.getenv("R_LIBS_USER")); renv::restore()'
# Install rsconnect to deploy app
##code to deploy using rsconnect
displayName: 'Install and restore R environment'
env:
R_LIBS_USER: $(Pipeline.Workspace)/R/library
< /code>
Das einzige [url=viewtopic.php?t=26065]Problem[/url] hierfür ist, dass R und Rscript kein System python3 sehen, das beim Versuch, die RenV -Wiederherstellung auszuführen, installiert wird: < /p>
    The following required system packages are not installed:
- cmake    [required by arrow]
- python2  [required by reticulate]
The R packages depending on these system packages may fail to install.

An administrator can install these packages with:
- sudo dnf install python2 cmake

- The library is already synchronized with the lockfile.
< /code>
Bitte beachten Sie, dass die Mindestanforderung für das Reticulate -Paket Python 2.7 beträgt und alle unsere Teammitglieder zumindest Python 3.10 verwenden.Error : Installation of Python not found, Python bindings not loaded.
See the Python "Order of Discovery" here: https://rstudio.github.io/reticulate/articles/versions.html#order-of-discovery.
[rsc-session] Received signal: interrupt
[rsc-session] Terminating subprocess with interrupt ...
Ist es möglich, den Python -Standort vor der Wiederherstellung und einem Schnappschuss irgendwie an Renv und Rscript zu übergeben?

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post