安装tensorflow为R与venv python?



我想为r安装tensorflow(和Keras)
我用了这些行

install.packages("keras")
install.packages("tensorflow")
library(keras)
library(tensorflow)

现在我想做:

install_tensorflow()
install_keras()

但是我的python环境不一致。是否有办法告诉R查找虚拟python环境?

感谢编辑:这是错误告诉我,我的环境是不一致的。

> install_tensorflow()
Collecting package metadata (current_repodata.json): ...working... done
Solving environment: ...working... 
The environment is inconsistent, please check the package plan carefully
The following packages are causing the inconsistency:
- defaults/win-64::anaconda==custom=py37_1
- defaults/win-64::bkcharts==0.2=py37_0
- defaults/noarch::dask==2.5.2=py_0
- defaults/noarch::ipywidgets==7.5.1=py_0
- defaults/noarch::jupyterlab==1.2.6=pyhf63ae98_0
- defaults/noarch::jupyterlab_server==1.1.4=py_0
- defaults/win-64::keras==2.2.4=0
- defaults/noarch::seaborn==0.10.1=py_0
- defaults/win-64::statsmodels==0.10.1=py37h8c2d366_0
- defaults/noarch::tensorboard==2.0.0=pyhb38c66f_1
- defaults/win-64::tensorflow==1.15.0=mkl_py37h3789bd0_0
- defaults/win-64::tensorflow-base==1.15.0=mkl_py37h190a33d_0
- defaults/noarch::tensorflow-estimator==1.15.1=pyh2649769_0
- defaults/win-64::widgetsnbextension==3.5.1=py37_0
- defaults/win-64::_anaconda_depends==2019.03=py37_0
- defaults/win-64::_ipyw_jlab_nb_ext_conf==0.1.0=py37_0
failed with initial frozen solve. Retrying with flexible solve.

谢谢@ tafter,我在尝试"virtualen"方法时错过了envname参数。之前。

解决方案是通过在函数中传递这些选项来创建一个新的虚拟环境:
install_tensorflow(method="virtualenv", envname="venv-R")

相关内容

  • 没有找到相关文章

最新更新