Ich habe knitr
für eine lange Zeit verwendet, in der Regel in der R Studio-Umgebung. Kürzlich habe ich Python (Version 3.4.1) auf meinem Windows-Rechner installiert, in den Pfad eingefügt und Yi Hui Xies sample document for Python ausprobiert. Die Python-Code-Chunks werden jedoch nicht ausgeführt. Aus einem Stück wie folgt aus:knitr wird nicht Python-Befehle ausführen
{r test-python, engine='python'}
x = 'hello, python world!'
print x
print x.split(' ')
Ich erhalte eine Fehlermeldung wie folgt aus:
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
Ich bin in Windows 7, läuft R 3.1.0, mit RStudio Version 0.98.847 (beta Vorschau Ausführung). Interaktives Python öffnet sich problemlos über die Befehlszeile.
Irgendwelche Ideen?