【发布时间】:2014-05-21 21:37:46
【问题描述】:
knitr我用了很久,一般是在R Studio环境下。最近在我的windows机器上安装了python(3.4.1版本),放到path下,试用了谢易慧的sample document for Python。但是 Python 代码块不会运行。从这样的块中:
{r test-python, engine='python'}
x = 'hello, python world!'
print x
print x.split(' ')
我收到如下错误消息:
Warning: running command '"python" -c "print '**Write** _something_ in `Markdown` from `Python`!'"' had status 1
running: "python" -c "x = 'hello, python world!'
print x
print x.split(' ')"
File "<string>", line 2
print x
^
SyntaxError: invalid syntax
我在 Windows 7 中,运行 R 3.1.0,RStudio 版本 0.98.847(测试预览版)。交互式 Python 可以从命令行很好地打开。
有什么想法吗?
【问题讨论】:
标签: r python-3.x knitr