重要的资料入口:https://blog.csdn.net/zimiao552147572/article/details/88867161
安装安装 Anaconda3:https://blog.csdn.net/qq_15192373/article/details/81091098
https://blog.csdn.net/flyfrommath/article/details/79837431
https://blog.csdn.net/LEILEI18A/article/details/79871423
在终端输入conda info --envs检验anaconda是否安装成功,发现报错:conda: command not found
原因是因为~/.bashrc文件没有配置好
vim ~/.bashrc
在最后一行加上
export PATH=$PATH:/home/jhon/anaconda3/bin
然后保存更改,运行
source ~/.bashrc
---------------------
作者:Vincent__Lai
来源:CSDN
原文:https://blog.csdn.net/weixin_38705903/article/details/86533863
版权声明:本文为博主原创文章,转载请附上博文链接!
conda install pytorch-cpu torchvision-cpu -c pytorch
二、ubuntu下安装scikit-learn库
首先我们先更新下所有包,输入如下命令:
sudo apt-get update #刷新软件仓库
sudo apt-get upgrape #更新所有包
出错解决方案:
Reading package lists... Done
E: Problem executing scripts APT::Update::Post-Invoke-Success
'if /usr/bin/test -w /var/cache/app-info -a -e /usr/bin/appstreamcli;
then appstreamcli refresh > /dev/null;
fi'
E: Sub-process returned an error code
在运行sudo apt-get update时出现如上信息,解决方法如下:
sudo pkill -KILL appstreamcli
wget -P /tmp https://launchpad.net/ubuntu/+archive/primary/+files/appstream_0.9.4-1ubuntu1_amd64.deb https://launchpad.net/ubuntu/+archive/primary/+files/libappstream3_0.9.4-1ubuntu1_amd64.deb
sudo dpkg -i /tmp/appstream_0.9.4-1ubuntu1_amd64.deb /tmp/libappstream3_0.9.4-1ubuntu1_amd64.deb
执行完上述命令之后再次运行sudo apt-get update就不会再出现上面的错误。
参考:
https://askubuntu.com/questions/774986/appstreamcli-hanging-with-100-cpu-usage-dur
然后我们安装scikit-learn所依赖的库,我用的是python3,故输入如下命令:
sudo apt-get install build-essential python3-dev python3-setuptools
python3-numpy python3-scipy
libatlas-dev libatlas3gf-base
强烈建议把pandas和matplotlib也安上,,另外xlrd和xlwt为python添加读写Excel的功能
sudo apt-get install pandas
sudo apt-get install matplotlib
万事俱备,现在安装pip:
sudo apt-get install python-pip
现在可以使用pip安装scikit-learn了!
pip install scikit-learn
作者:不吃肉饼只喝汤
链接:https://www.jianshu.com/p/40e14b5e869b
来源:简书
简书著作权归作者所有,任何形式的转载都请联系作者获得授权并注明出处。