This is the first day of my participation in Gwen Challenge
I have been planning to learn AI knowledge, but I am ashamed that I have not been able to start due to various reasons and reasons. In the end, or their own lazy, intermittent understanding, but has failed to stick to it. I hope that the beginning of this time can make me stick to it, learn from scratch and systematically understand relevant knowledge and apply it.
The overall environment is based on Python3. The Python environment is generally created by Conda, and the coding environment is usually coded by Jupyter Notebook or Spyder, which are similar to IDE but can be convenient for viewing related content and debugging in the process.
Conda – installation
Conda is a Python environment management tool, which can easily create an environment based on the specified Python version. It will add some common packages on the basis of the basic environment to help use. Conda is divided into two versions: Anaconda and Miniconda. Anaconda is a tool introduced on the basis of basic functions and many scientific calculations, while Miniconda is a relatively simplified version excluding other third-level tools. If you want to use Anaconda directly, you can. Through can be downloaded from the website, directly install:
- Download: miniconda docs. Conda. IO/en/latest/m…
- Anaconda download: www.anaconda.com/products/in…
Mac users can also install directly from BREW:
brew install anaconda
brew install miniconda
Copy the code
Conda – Modify the source
Conda can modify the source to speed up the installation when we are finished. Let’s use the conda install command to get a faster installation speed.
The first step is to create a.condarc file
vim ~/.condarc
Copy the code
Copy the following into the file
channels:
- defaults
show_channel_urls: true
channel_alias: https://mirrors.tuna.tsinghua.edu.cn/anaconda
default_channels:
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/pro
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
custom_channels:
conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
msys2: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
bioconda: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
menpo: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
simpleitk: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
Copy the code
Specific can consult mirrors.tuna.tsinghua.edu.cn/help/anacon…
Conda – use
First we need to create the Python environment we need via Conda:
Conda create -n myenv python=3.6Copy the code
Conda create allows us to create our operating environment. -n indicates the name of the environment we need to specify, and Python =3.6 is the python version we specify
conda activate myenv
Copy the code
You can activate the corresponding environment by using conda Activate
conda install numpy
Copy the code
Conda Install installs the corresponding packages in the current environment
These are the basic operations in Conda
jupyter notebook & spyder
Once we have the Python environment ready we have to choose our development environment, and I know of two options for jupyter Notebook & Spyder. Jupyter Notebook is a web based coding environment that can be developed through a browser, while Spyder is a desktop based coding environment. I chose spyder here because I found it easier to debug.
Installing jupyter Notebook is simple:
conda install jupyter notebook
Copy the code
To install the jupyter Notebook, run the Conda install command on the TERMINAL to start the Jupyter Notebook service
jupyter notebook
Copy the code
Install spyder and perform the following operations:
conda create -n spyder-env spyder=4 numpy scipy pandas matplotlib sympy cython
Copy the code
Spyder can be started by executing spyder in the environment after successful installation
spyder
Copy the code
In this chapter we’ve looked at environmental preparation before learning artificial intelligence, and then we’re going to look at some other basic concepts.