r
  • docker
  • repository
  • dockerfile
  • mxnet
  • 2016-12-10 70 views 1 likes 
    1

    我想在我的Dokerfile中添加DMLC回購,以便我可以安裝mxnet軟件包。我這樣做如下:向dockerfile添加回購

    RUN R -e "install.packages('drat', repos='https://cran.rstudio.com')" 
    RUN R -e "drat::addRepo('dmlc')" 
    RUN R -e "install.packages('mxnet', #repos='https://dmlc.github.io/drat', dependencies=TRUE)" 
    

    這是行不通的。出人意料的是,我發現,即使我加入DMLC回購,實際上它是不是當我打印出以下命令的輸出補充說:

    RUN R -e "print(getOption('repos'))" 
    

    要解決這個問題,我指定的回購明確如下:

    #RUN R -e "install.packages('mxnet', #repos='https://dmlc.github.io/drat', dependencies=TRUE)" 
    

    仍然沒有工作。它拋出一個錯誤說:

    this is screenshot of the error

    任何幫助嗎?所有我想做的事情是在準備我的容器時在我的Dockerfile中安裝mxnet。

    +0

    我發現DMLC回購與Mac/Windows的回購協議。 – owise

    回答

    1

    幾點建議:

    1. 確保R命令Dockerfile外成功運行您泊塢窗使用它們之前。對於您遇到的錯誤消息,該文件不存在,因此安裝失敗:http://dmlc.ml/drat/src/contrib/mxnet_0.7.tar.gz

    2. 我試着在MacOS X埃爾卡皮坦下列步驟和相關的軟件包,rgexf和XML面臨的一個錯誤。但是,您可以檢查下面的步驟是否在您的環境中正常工作?

    https://mxnet.incubator.apache.org/get_started/install.html

    cran <- getOption("repos") 
        cran["dmlc"] <- "https://s3-us-west-2.amazonaws.com/apache-mxnet/R/CRAN/" 
        options(repos = cran) 
        install.packages("mxnet") 
    

    錯誤由我遇到:

    Error in download.file(url, destfile, method, mode = "wb", ...) : 
        cannot download all files 
    In addition: Warning message: 
    In download.file(url, destfile, method, mode = "wb", ...) : 
        URL 'https://s3-us-west-2.amazonaws.com/apache-mxnet/R/CRAN/src/contrib/mxnet_0.10.1.tar.gz': status was '404 Not Found' 
    Warning in download.packages(pkgs, destdir = tmpd, available = available, : 
        download of package ‘mxnet’ failed 
    ... 
    ... 
    ... 
    ERROR: dependency ‘rgexf’ is not available for package ‘DiagrammeR’ 
    * removing ‘/usr/local/lib/R/3.3/site-library/DiagrammeR’ 
    
    The downloaded source packages are in 
        ‘/private/var/folders/b2/d3rhxz3504q3q42dlx994wmnc9mg23/T/RtmpoUy7j7/downloaded_packages’ 
    Warning messages: 
    1: In install.packages("mxnet") : 
        installation of package ‘XML’ had non-zero exit status 
    2: In install.packages("mxnet") : 
        installation of package ‘igraph’ had non-zero exit status 
    3: In install.packages("mxnet") : 
        installation of package ‘rgexf’ had non-zero exit status 
    4: In install.packages("mxnet") : 
        installation of package ‘DiagrammeR’ had non-zero exit status 
    

    然後,我想:

    cran <- getOption("repos") 
    cran["dmlc"] <- "https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/R/CRAN/" 
    options(repos = cran) 
    install.packages("mxnet") 
    
    Error in download.file(url, destfile, method, mode = "wb", ...) : 
        cannot download all files 
    In addition: Warning message: 
    In download.file(url, destfile, method, mode = "wb", ...) : 
        URL 'https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/R/CRAN/src/contrib/mxnet_0.10.1.tar.gz': status was '404 Not Found' 
    Warning in download.packages(pkgs, destdir = tmpd, available = available, : 
        download of package ‘mxnet’ failed 
    

    注:此錯誤並不雖然停止安裝直到我碰到爲止■錯誤:

    ** R 
    ** demo 
    ** inst 
    ** preparing package for lazy loading 
    ** help 
    *** installing help indices 
    ** building package indices 
    ** testing if installed package can be loaded 
    Error in dyn.load(file, DLLpath = DLLpath, ...) : 
        unable to load shared object '/usr/local/lib/R/3.3/site-library/igraph/libs/igraph.so': 
        dlopen(/usr/local/lib/R/3.3/site-library/igraph/libs/igraph.so, 6): Library not loaded: @rpath/libxml2.2.dylib 
        Referenced from: /usr/local/lib/R/3.3/site-library/igraph/libs/igraph.so 
        Reason: image not found 
    Error: loading failed 
    Execution halted 
    ERROR: loading failed 
    * removing ‘/usr/local/lib/R/3.3/site-library/igraph’ 
    * restoring previous ‘/usr/local/lib/R/3.3/site-library/igraph’ 
    ERROR: dependency ‘XML’ is not available for package ‘rgexf’ 
    * removing ‘/usr/local/lib/R/3.3/site-library/rgexf’ 
    ERROR: dependency ‘rgexf’ is not available for package ‘DiagrammeR’ 
    * removing ‘/usr/local/lib/R/3.3/site-library/DiagrammeR’ 
    

    這是可能的,這些步驟可能您的操作系統和環境上工作。所以請嘗試他們並在此發佈您的發現。

    後來,我在github上發現了這個問題。所以,你可以跟蹤這個問題有:

    https://github.com/apache/incubator-mxnet/issues/8926

    相關問題