首页 > 解决方案 > 运行 featuretoolsR 时出现词法错误

问题描述

为了测试 featuretools 的工作,我通过 RStudio 安装了 featuretoolsR,并在 Python 中安装了 numpy 和 featuretools。

但是,在尝试创建实体时出现以下错误

# Libs
library(featuretoolsR)
library(magrittr)

# Create some mock data
set_1 <- data.frame(key = 1:100, value = sample(letters, 100, T))
set_2 <- data.frame(key = 1:100, value = sample(LETTERS, 100, T))

# Create entityset
es <- as_entityset(set_1, index = "key", entity_id = "set_1", id = "demo")```

Error: lexical error: invalid char in json text.
                                       WARNING: The conda.compat modul
                     (right here) ------^

Kindly help in diagnosing and providing solution to same.

标签: rfeaturetools

解决方案


更新到 conda 版本 4.6.11 后,同样的警告发生在我身上。我认为问题是由于 compat.py 脚本末尾的 print 语句产生的。我知道这不是一个很好的解决方法,但我访问了 compat.py 文件并删除了打印语句:

print("WARNING: The conda.compat module is deprecated and will be removed in a future release.", file=sys.stderr) 

该文件应位于此处:\Anaconda3\pkgs\conda-4.6.11-py37_0\Lib\site-packages\conda

我希望它有所帮助。


推荐阅读