【问题标题】:Can't make `pandas` module available in `reticulate`无法在“网状”中使用“熊猫”模块
【发布时间】:2021-02-26 20:51:15
【问题描述】:

我尝试在R中使用keras,当我尝试调用flow_images_from_dataframe()时出现错误:

Error in flow_images_from_dataframe() : 
  Pandas (python module) must be installed in the same environment as Keras.Install it using reticulate::virtualenv_install("pandas", envname = "r-tensorflow") or reticulate::conda_install("pandas", envname = "r-tensorflow") depending on the kind of environment you are using.

我尝试了以下方法:

reticulate::py_module_available("pandas")
# FALSE.

# checking that environment is there:
reticulate::virtualenv_list()
# "r-reticulate" "r-tensorflow"

# activate the environment:
use_virtualenv('r-tensorflow')

reticulate::virtualenv_install("pandas", envname = "r-tensorflow")
# ...
# ...
# Installing collected packages: pandas
# Successfully installed pandas-1.1.5

# Trying again:
py_module_available("pandas")
# FALSE

# The issue is specific to pandas, other modules are fine:
reticulate::py_module_available('scipy')
# TRUE

【问题讨论】:

    标签: r pandas keras rstudio reticulate


    【解决方案1】:

    我仍然不明白那里的问题是什么以及为什么 virtualenv_install() 没有完成这项工作,但帮助我的解决方案很简单

    py_install("pandas")
    

    【讨论】:

      猜你喜欢
      • 2019-03-08
      • 2019-04-30
      • 2019-12-17
      • 2021-11-20
      • 1970-01-01
      • 2019-10-05
      • 2021-07-25
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多