环境搞坏了,conda无法识别了
删除:rm -rf anaconda3
rm -rf .conda
修改.bashrc
20181210,第二次,
1,安装anaconda4.2
source activate root
执行:
pip -V
sudo pip -V
=>sudo pip 和pip指向不同
find . -name pip
=>真实可用的pip命令有2个
2,创建新环境,升级新环境pip,核对新旧环境pip不同
conda create -n py35 python=3.5
source activate py35 && pip install --upgrade pip && pip -V(在升级pip之前应当conda install pip 为独立环境py35安装独立pip,但这里没执行也好了,之前是不行的,pip是同一个,会和root同步升级)
和source activate root & pip -V结果已经不同了,说明pip环境的确独立了
(source activate root && pip -V)
3,安装公共组件
pip install xgboost && pip list|grep xgboost,有
source activate root && pip list|grep xgboost,无
说明环境独立ok
配置alias:alias pip_py35='sudo /home/john/anaconda3/envs/py35/bin/pip'。source ~/.bashrc
pip_py35 install minepy
pip_py35 install tpot (source activate root && pip list|grep TPOT,无。source activate py35 && pip list|grep TPOT,有.pip_py35|grep TPOT,有 )
pip_py35 install auto_ml (source activate root && pip list|grep auto-ml,无。source activate py35 && pip list|grep auto-ml,有.pip_py35|grep auto-ml,有 )
以上命令,在系统sh中,激活root的sh中都可以执行,并且都可以正确安装,
4,环境mlbox(clone py35)
conda create -n mlbox --clone py35 && conda env list && source activate mlbox
检查: pip -V,9.0,不正常,应当继承py35的版本18,暂不理会
pip list|grep TPOT,有,正常
pip list|grep auto-ml,有,正常
pip install --upgrade pip && pip -V,提示已经up to date了。暂不理会
pip install mlbox提示xgboost不满足版本条件
改采用之前的代码方式安装
cd ~/PYTHON/MLBox/python-package/ && python setup.py install
报错:
['matplotlib>=2.0.2', 'hyperopt>=0.1', 'Keras>=2.0.4', 'joblib>=0.11', 'Theano>=0.9.0', 'networkx>=1.11']
Please install them manually
error: Aborting
解决:pip install matplotlib hyperopt Keras joblib Theano networkx,执行ok
在执行:cd ~/PYTHON/MLBox/python-package/ && python setup.py install。执行ok
检查: pip list|grep mlbox,有。
添加alias别名
alias pip_mlbox='sudo /home/john/anaconda3/envs/mlbox/bin/pip'。source ~/.bashrc
验证别名:pip_mlbox list|grep mlbox,有,正常。
5,环境autosklearn(clone mlbox)
conda create -n autosklearn --clone mlbox && conda env list && source activate autosklearn &&pip -V,版本为9.0,mlbox也是9.0,暂认为正确
pip install --upgrade pip && pip -V,提示已经up to date了。暂不理会
参考git安装指导:https://github.com/automl/auto-sklearn/blob/master/doc/installation.rst
curl https://raw.githubusercontent.com/automl/auto-sklearn/master/requirements.txt | xargs -n 1 -L 1 pip install
安装报错pyrfr。
参考:Can't install auto-sklearn due to pyrfr dependency #101,https://github.com/automl/auto-sklearn/issues/101
{
conda install swig --yes
pip install pyrfr # probably don't need this b/c it reinstalls in auto-sklearn
pip install auto-sklearn
}
pip install auto-sklearn。ok
7,qtia
pip_autosklearn install seaborn
pip_autosklearn install mlxtend
参考:
MAC中Python如何通过pip将packages安装到Conda环境中:https://www.jianshu.com/p/7e4c29a26f29