Ошибка: Попытка угадать ДОМОЙ R, но нет команды 'R' в ПУТИ - PullRequest
0 голосов
/ 23 мая 2019

Я видел так много вопросов об этой ошибке, но ни одно из предложенных решений, похоже, не работает для меня. Я развертываю приложение Python на Heroku, но получаю эту ошибку при нажатии. я использую https://github.com/virtualstaticvoid/heroku-buildpack-r.git#heroku-16 и heroku / python как две сборки для моего приложения. Я на Python 3.6.8 и установка rpy2 2.9.5

При развертывании heroku сначала устанавливает R (успешно, в хранилище есть файл init.R), затем обнаруживает приложение как приложение Python и выполняет установку зависимостей (в файле require.txt) и выдает ошибку, когда она добирается до rpy2==2.9.5

Я видел этот ответ , но не мог понять, как бы я попробовал это на Heroku.

Вот полный журнал попытки развертывания

-----> R Console app detected
-----> Vendoring R 3.4.4 for heroku-16 stack (latest)
       Retrieving R binaries from cache
-----> Executing R init script
       Installing package into ‘/usr/local/lib/R/site-library’
       (as ‘lib’ is unspecified)
       trying URL 'https://cloud.r-project.org/src/contrib/blockTools_0.6-3.tar.gz'
       Content type 'application/x-gzip' length 51373 bytes (50 KB)
       ==================================================
       downloaded 50 KB

       * installing *source* package ‘blockTools’ ...
       ** package ‘blockTools’ successfully unpacked and MD5 sums checked
       ** libs
       gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c getDist.c -o getDist.o
       gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c naive.c -o naive.o
       gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c optgreed.c -o optgreed.o
       gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c util.c -o util.o
       g++ -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o blockTools.so getDist.o naive.o optgreed.o util.o -L/usr/lib/R/lib -lR
       installing to /usr/local/lib/R/site-library/blockTools/libs
       ** R
       ** data
       ** demo
       ** inst
       ** preparing package for lazy loading
       ** help
       *** installing help indices
       ** building package indices
       ** testing if installed package can be loaded
       * DONE (blockTools)

       The downloaded source packages are in
        ‘/tmp/RtmpKojUrP/downloaded_packages’
       Loading required package: blockTools
       Unit 1 data stored as file sdata.RData.
       The current working directory is /
       Unit 1 assigned to Treatment 2.
       The new data as entered:
                  ID [API INPUT] age          Tr
       1 [API INPUT] [API INPUT]  25 Treatment 2
       R 3.4.4 successfully installed (with init)
-----> Caching build outputs
       Build took 50 seconds to complete
-----> Python app detected
-----> Installing python-3.6.8
-----> Installing pip
-----> Installing SQLite3
-----> Installing requirements with pip
       Collecting falcon==1.4.1 (from -r /tmp/build_888a086087211b8118b0e152044beded/requirements.txt (line 1))
         Downloading https://files.pythonhosted.org/packages/e8/d0/20bb807dee65f1f163754670557b128eafce1710f6c9c363a38e357f3783/falcon-1.4.1-py2.py3-none-any.whl (159kB)
       Collecting gunicorn==19.8.1 (from -r /tmp/build_888a086087211b8118b0e152044beded/requirements.txt (line 2))
         Downloading https://files.pythonhosted.org/packages/55/cb/09fe80bddf30be86abfc06ccb1154f97d6c64bb87111de066a5fc9ccb937/gunicorn-19.8.1-py2.py3-none-any.whl (112kB)
       Collecting Jinja2==2.10 (from -r /tmp/build_888a086087211b8118b0e152044beded/requirements.txt (line 3))
         Downloading https://files.pythonhosted.org/packages/7f/ff/ae64bacdfc95f27a016a7bed8e8686763ba4d277a78ca76f32659220a731/Jinja2-2.10-py2.py3-none-any.whl (126kB)
       Collecting MarkupSafe==1.0 (from -r /tmp/build_888a086087211b8118b0e152044beded/requirements.txt (line 4))
         Downloading https://files.pythonhosted.org/packages/4d/de/32d741db316d8fdb7680822dd37001ef7a448255de9699ab4bfcbdf4172b/MarkupSafe-1.0.tar.gz
       Collecting python-mimeparse==1.6.0 (from -r /tmp/build_888a086087211b8118b0e152044beded/requirements.txt (line 5))
         Downloading https://files.pythonhosted.org/packages/26/2e/03bce213a9bf02a2750dcb04e761785e9c763fc11071edc4b447eacbb842/python_mimeparse-1.6.0-py2.py3-none-any.whl
       Collecting rpy2==2.9.5 (from -r /tmp/build_888a086087211b8118b0e152044beded/requirements.txt (line 6))
         Downloading https://files.pythonhosted.org/packages/02/d1/074ffbbe7b4bf74c60b75d74c8e67a1e4515b0d85f85cd6540e39610754a/rpy2-2.9.5.tar.gz (194kB)
           Complete output from command python setup.py egg_info:
           Error: Tried to guess R's HOME but no command 'R' in the PATH.

           ----------------------------------------
       Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-d2_abgxe/rpy2/
 !     Push rejected, failed to compile Python app.
 !     Push failed
...