在我的 Mac 上使用 dask 安装 Modin 并尝试并行化一些 pandas 代码后,出现以下错误:
RuntimeError: Python is not installed as a framework. The Mac OS X backend will not be able to function correctly if Python is not installed as a framework.
这是堆栈跟踪的一部分:
File "/Users/x/miniconda3/lib/python3.6/runpy.py", line 96, in _run_module_code
mod_name, mod_spec, pkg_name, script_name)
File "/Users/borismetodiev/miniconda3/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/Users/x/src/test-data-generator/data-generator/x/scripts/train_model.py", line 36, in <module>
from x import app
File "/Users/x/src/data-generator/test-data-generator/x/x/app.py", line 15, in <module>
import matplotlib.pyplot as plt
File "/Users/x/miniconda3/lib/python3.6/site-packages/matplotlib/pyplot.py", line 115, in <module>
_backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
File "/Users/x/miniconda3/lib/python3.6/site-packages/matplotlib/backends/__init__.py", line 32, in pylab_setup
globals(),locals(),[backend_name],0)
File "/Users/borismetodiev/miniconda3/lib/python3.6/site- packages/matplotlib/backends/backend_macosx.py", line 19, in <module>
from matplotlib.backends import _macosx
我之前遇到过这个错误,并且能够通过安装py并使用python而不是python运行脚本来解决问题,那么为什么matplotlib突然认为我没有将python安装为框架?
我运行 pip install “modin[dask]”,然后 pip install “dask[dataframe]”,然后导入 modin.pandas。任何帮助将非常感激。