AI常用环境安装

 

torch环境

conda create --name py37 python=3.7

conda activate py37

pip install jieba==0.42.1
pip install pandas==1.2.4
pip install pydot==1.3.0
pip install pydotplus==2.0.2
pip install pyplotz==0.24
pip install pyspark==2.2.1
pip install scikit-learn==0.24.2
pip install termcolor==1.1.0
pip install tqdm==4.61.1
pip install xgboost==1.4.2

pip install matplotlib

 

pytorch安装

https://pytorch.org/get-started/locally/

torch的linux GPU环境 ,CUDA 10.2

pip3 install torch torchvision torchaudio

conda install pytorch torchvision torchaudio cudatoolkit=10.2 -c pytorch

 在进行GPU安装时,pip不需要指定CUDA的版本

 

 

torch的linux CPU环境

pip3 install torch==1.9.0+cpu torchvision==0.10.0+cpu torchaudio==0.9.0 -f https://download.pytorch.org/whl/torch_stable.html
conda install pytorch torchvision torchaudio cpuonly -c pytorch

 

conda install pyqt
pip install opencv-python==4.1.2.30

 

设置默认ubantu默认的python为conda的python环境

conda config --set auto_activate_base false  #默认不启动conda环境

root@aisty:~# cat /etc/profile|grep conda
export PATH=/opt/app/anaconda3/envs/py37/bin:/opt/app/anaconda3/bin:$PATH

 

posted @ 2021-07-30 22:02  方诚  阅读(109)  评论(0编辑  收藏  举报