Code: Select all
>>> `import rpy2`
>>> `from rpy2.robjects.packages import importr`
'sh' is not recognized as an internal or external command,
operable program or batch file.
Error importing in API mode: ImportError('On Windows, cffi mode "ANY" is only "ABI".')
Trying to import in ABI mode.
Ich habe online nachgeschaut. Es gibt eine von Google AI vorgeschlagene Lösung, die besagt, dass C:\Program Files\Git\bin zu PATH in der Einstellung „Umgebungsvariablen“ hinzugefügt werden soll. C:\Programme\Git\bin ist der Speicherort von sh.exe und kann anders sein, wenn Sie einen anderen Speicherort haben.
Nachdem ich die Einstellung geändert habe, führen Sie meinen Importcode erneut aus. Ich habe eine weitere Fehlermeldung erhalten:
Code: Select all
>>> `from rpy2.robjects.packages import importr`
C:\PROGRA~1\R\R-43~1.1/bin/config.sh: line 187: make: command not found
C:\PROGRA~1\R\R-43~1.1/bin/config.sh: line 188: make: command not found
C:\PROGRA~1\R\R-43~1.1/bin/config.sh: line 189: make: command not found
C:\PROGRA~1\R\R-43~1.1/bin/config.sh: line 190: make: command not found
C:\PROGRA~1\R\R-43~1.1/bin/config.sh: line 191: make: command not found
R was not built as a library
Traceback (most recent call last):
File "", line 1, in
File "C:\...\Lib\site-packages\rpy2\robjects\__init__.py", line 17, in
import rpy2.rinterface as rinterface
File "C:\...\Lib\site-packages\your textrpy2\rinterface\__init__.py", line 25, in
from rpy2.rinterface_lib import openrlib
File "C:\...\Lib\site-packages\rpy2\rinterface_lib\openrlib.py", line 21, in
for libpath in rpy2.situation.get_r_flags(R_HOME, '--ldflags')[0].L:
TypeError: 'NoneType' object is not iterable
Im Moment muss ich also die Fehlermeldung „sh“ so lassen, wie sie ist. Ich frage mich, ob jemand auf das gleiche Problem stößt oder eine Lösung findet.
Google Ai schlägt außerdem vor, das rpy2-Paket neu zu installieren. Da rpy2 neu installiert ist, gibt es keine Möglichkeit, es erneut zu installieren.
Mobile version