Fork me on GitHub

anaconda

Use Anaconda to manage your python envs

Anaconda is very convenient tool to manage multiple virtual envs of python in your PC.
So you can enjoy different version of python, avoid conflictions between different projects.
This blog I will introduce how to install anaconda & install envs for tensorflow(CPU)Scrapy

Install anaconda

  1. Go to the official website to download latest Anaconda.
  2. Install Anaconda with default configurations.
    • Of course you can change the location wherever you like to install it;
    • Don’t recommend you to add Anaconda to the system PATH env var.

Manage envs with Anaconda

common commands:

1
2
3
4
5
6
7
8
9
10
# check current env
conda info -e
# create new env with specific version of python
conda create -n env_name python=2.7
# switch envs
activate env_name
# exit env
deacticate env_name
# remove env
conda remove -n env_name --all

Manage packages with Anaconda

1
2
3
4
5
6
7
8
9
10
# install new pkgs
conda search pkg_name
conda install pkg_name
# check installed pkg list
conda list
# update pkgs
conda update pkg_name
conda update anaconda
# remove pkgs
conda removw pkg_name

Use domestic mirrors

In order to install and upgrade easily in China. We should specifically allocate domestic mirrors to it.

  1. find .condarcin C:\Users\user_name\.condarc
  2. remove - default
  3. Open Anaconda Prompt,input:
1
2
3
4
5
6
7
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/

conda config --set show_channel_urls yes

To ensure that pkgs you use does not interfere with each other. Better to create new envs for them.

Install tenflow(CPU)

1
2
3
conda create -n tensorflow python=3.5
activate tensorflow
conda install tensorflow

Install Scrapy

1
2
3
conda create -n py27 python=2.7
activate py27
conda install -c conda-forge scrapy

Wait a moment & have a cup of tea~

-------------The end Thanks-------------
You donation will be huge motivation for me.