reaching python with R -
i trying install tensorflow in rstudio
, when run install_tensorflow()
, get
error: prerequisites installing tensorflow not available. execute following @ terminal install prerequisites: $ sudo pip install --upgrade virtualenv
but virtualenv
installed.
i don't konw thing python.
i using osx
.
which python
outputs
`/home/name/.pyenv/shims/python`
but when going python
console,
python 2.7.10 (default, dec 3 2015, 00:46:36) [gcc 4.2.1 compatible apple llvm 7.0.0 (clang-700.1.76)] on darwin type "help", "copyright", "credits" or "license" more information. >>> import sys >>> sys.executable '/home/name/.pyenv/versions/2.7.10/bin/python'
system("python --version")
in rstudio
outputs
python 2.7.10
so tried put in .rprofile
sys.setenv(path = paste("/home/name/.pyenv/versions/2.7.10/bin/python", sys.getenv("path"), sep=":"))
or
sys.setenv(path = paste("/home/name/.pyenv/shims/python", sys.getenv("path"), sep=":"))
besides, see tensorflow
packages indeed installed
/home/name/.pyenv/versions/2.7.10/lib/python2.7/site-packages
someone has idea ?
update:
since python tensorflow
package installed in system, located under /home/name/.pyenv/somepath/
, tried run tensorflow function directly inside rstudio
, got this
error: installation of tensorflow not found. python environments searched 'tensorflow' package: /usr/bin/python can install tensorflow using install_tensorflow() function.
knowing running sys.getenv()
in rstudio
gives correct path
path /home/name/.pyenv/versions/2.7.10/bin/python:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/x11/bin:/usr/texbin:/opt/local/bin
update 2
now, think beginning locate problem. forced rstudio
use version of python
when run sys.executable '/home/name/.pyenv/versions/2.7.10/bin/python'
so use_python("/home/name/.pyenv/versions/2.7.10/bin/python")
now, when run tensorflow
function
error: python module tensorflow not found.
detected python configuration:
python: /usr/bin/python libpython: /system/library/frameworks/python.framework/versions/2.7/lib/python2.7/config/libpython2.7.dylib pythonhome: /system/library/frameworks/python.framework/versions/2.7:/system/library/frameworks/python.framework/versions/2.7 version: 2.7.10 (default, oct 23 2015, 19:19:21) [gcc 4.2.1 compatible apple llvm 7.0.0 (clang-700.0.59.5)] numpy: /system/library/frameworks/python.framework/versions/2.7/extras/lib/python/numpy numpy_version: 1.8.1 tensorflow: [not found]
it seems rstudio
doesn't take account version want use
solution : find problem came , how tackle it, here
Comments
Post a Comment