我正在尝试使用Reticulate包通过R使用Python。我使用Sys.setenv(RETICULATE_PYTHON = "/usr/local/bin/python3")
成功将Reticulate连接到Python 3.6。然后在注意到我的Python 3.6没有Numpy后,我在命令行中使用了输入pip3 install numpy
并安装了它。现在,当我拨打py_config()
时,我遇到了以下网格问题:
py_config()
Error in py_run_string_impl(paste0("import sys; sys.path.append('", system.file("python", :
ImportError: cannot import name 'dtype'
Detailed traceback:
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/numpy/__init__.py", line 142, in <module>
from . import add_newdocs
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/numpy/add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/numpy/lib/__init__.py", line 8, in <module>
from .type_check import *
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/numpy/lib/type_check.py", line 11, in <module>
import numpy.core.numeric as _nx
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/numpy/core/__init__.py", line 35, in <module>
from . import _internal # for freeze programs
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/nump
卸载Numpy修复了问题,但后来我没有Numpy。 :(
有人能告诉我发生了什么以及如何解决这个问题吗?