Machine learning environment construction

table of Contents

1>Download and install Git

2>Get the latest required code

3>Download and install Anaconda3

4>Install OpenCV in conda environment

5>Other operations


1>Download and install Git

download link:

https://git-scm.com/downloads

Installation tutorial:

https://www.cnblogs.com/xueweisuoyong/p/11914045.html

2>Get the latest required code

Enter the folder where you want to place the download code:

cd C:\Users\Kannyi\Machine-Learning

Obtain a copy of the latest code locally and download the code to a folder called opencv-machine-learning:

git clone https://github.com/mbeyeler/opencv-machine-learning.git

After a period of time, the online code may be modified. In this case, you can use the following command to update the local clone code:

cd C:\Users\Kannyi\Machine-Learning\opencv-machine-learning
git pull origin master

3>Download and install Anaconda3

download link:

https://www.anaconda.com/products/individual

installation path:

D:\Anaconda3

Configure environment variables:

My Computer-->Properties-->Advanced System Settings-->Advanced-->Environment Variables-->System Variables-->Edit Path Variables-->New

  • D:\Anaconda3

  • D:\Anaconda3\Scripts

  • D:\Anaconda3\Library\mingw-w64\bin

  • D:\Anaconda3\Library\bin

4>Install OpenCV in conda environment

Jump to the folder where the code is downloaded:

cd C:\Users\Kannyi\Machine-Learning\opencv-machine-learning

Add the conda-forge channel to the trust channel of conda:

conda config --add channels conda-forge

Create a conda environment based on Python3.8, where py38 is the environment name defined by yourself :

conda create -n py38 python=3.8

Activate this environment:

activate py38

Open a new IPython session:

ipython

Verify the installation result:

import sys
print(sys.version)

Install OpenCV:

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple opencv-python

View the version number of OpenCV:

cv2.__version__

5>Other operations

Exit the IPython shell:

  • Enter exit to exit directly.
  • Or press Ctrl+D first , and then enter y to complete the exit operation.

Obtain and run the code of this book in the browser. For details of the book, see the picture in the classified column:

jupyter notebook

Guess you like

Origin blog.csdn.net/Kannyi/article/details/112401944