Python Environment Setup in Linux

1. Download anaconda

Anaconda installer for linxu: https://www.anaconda.com/distribution/#linux

wget https://repo.anaconda.com/archive/Anaconda3-2020.02-Linux-x86_64.sh

2. Installation

bash Anaconda3-2020.02-Linux-x86_64.sh

3. Add path

echo 'export PATH="~/anaconda3/bin:$PATH"' >> ~/.bashrc
source .bashrc

4. Test

conda - version 
python --version

5. Upgrade (optional)

conda upgrade --all

6. Set up the environment

conda create -n env_name python=3.7 anaconda
conda activate env_name

Conda environment related operations

Inquire

conda env list

drop out

conda deactivate

Delete the environment

conda env remove --name env_name

 

7. Install the package

Image packages

pip install torch torchvision -f https://download.pytorch.org/whl/torch_stable.html --no-dependencies
pip install scikit-learn==0.21.3
pip install six
pip install scipy==1.1.0
pip install web.py==0.40.dev1
pip install opencv-python
pip install Django
conda install pillow=6.2.1
conda install cudnn=7.6.5
conda install cudatoolkit=10.0

NLP packages

pip install altgraph==0.16.1 pdfminer.six
pip install beautifulsoup4==4.7.1
pip install bs4==0.0.1 xlrd==1.2.0
pip install future==0.17.1 mammoth==1.4.10
pip install joblib==0.11 macholib==1.11 numpy==1.17.3
pip install pefile==2019.4.18 PyInstaller==3.4 regex==2019.4.14 pandas==0.24.2 chardet==3.0.4 textile==3.0.4
pip install scikit-learn==0.21.3 scipy==1.3.0 setuptools==40.6.2 soupsieve==1.9.1 pkuseg==0.0.22 gensim==3.7.1

 

8. Install IDE

Pycharm: http://macappstore.org/pycharm/

 

Guess you like

Origin www.cnblogs.com/sherrydatascience/p/12729877.html