Mac + python 3.7 + 安装 sklearn

转载自:github

安装错误信息:

......
sklearn/cluster/_dbscan_inner.cpp:6029:24: error: ‘PyThreadState’ has no member named ‘exc_type’
     tmp_type = tstate->exc_type;
                        ^
sklearn/cluster/_dbscan_inner.cpp:6030:25: error: ‘PyThreadState’ has no member named ‘exc_value’
     tmp_value = tstate->exc_value;
......

解决:

(1)前提:系统已安装好numpy,scipy

(2)安装Cython:

pip3 install cython

(3)安装sklearn:

pip3 install git+https://github.com/scikit-learn/scikit-learn

你可能感兴趣的:(Mac + python 3.7 + 安装 sklearn)