Softhat project environment construction

Anaconda installation

Reference article

Anaconda official website download address: https://www.anaconda.com/products/individual#download-section

anaconda (windows) link: https://pan.baidu.com/s/1vyr-7WISMa-XBXm7WwaTlw
Extraction code: fe6w

Anaconda's download file is relatively large (about 500 MB) because Anaconda comes with the most commonly used data science package in Python.

If Python is already installed on your computer, the installation will not affect you in any way. In fact, the default Python used by scripts and programs is the Python that comes with Anaconda.

Note: If you are on a windows 10 system, note that when installing the Anaconda software, right-click the anaconda software → choose to run as an administrator.
Specific installation steps:

  1. Go to the official download page to download. There are two versions to choose from: Python 3.6 and Python 2.7. After selecting the version, click "64-Bit Graphical Installer" or "32-Bit Graphical Installer" to download according to your operating system.

  2. After the download is complete, double-click the downloaded file to start the installer.

Note:
① If you encounter any problems during the installation process, temporarily close the anti-virus software and open it again after the installation procedure is completed.

② If you select "Install for all users" during installation, uninstall Anaconda and reinstall it, only for "me user".

  1. Select "Next".

  2. Read the terms of the license agreement, then check "I Agree" and proceed to the next step.

  3. Unless you are installing as an administrator for all users, just check "Just Me" and click "Next".

  4. In the "Choose Install Location" interface, select the target path to install Anaconda, and then click "Next".

Note:
① The target path cannot contain spaces and cannot be "unicode" encoding.

② Do not install as an administrator unless you are required to install with administrator rights.

image

  1. In "Advanced Installation Options", do not check "Add Anaconda to my PATH environment variable." ("Add Anaconda to my environment variable."). Because if checked, it will affect the use of other programs. If you use Anaconda, you can use it by opening Anaconda Navigator or in the "Anaconda Prompt" (similar to "Terminal" in macOS) in the start menu.

Unless you plan to use multiple versions of Anaconda or multiple versions of Python, check "Register Anaconda as my default Python 3.6".

Then click "Install" to start the installation. If you want to view the installation details, you can click "Show Details".

image

  1. Click "Next".

  2. Entering the "Thanks for installing Anaconda!" interface means that the installation is successful, click "Finish" to complete the installation.

Note: If you don't want to know about "Anaconda Cloud" and "Anaconda Support", you can uncheck "Learn more about Anaconda Cloud" and "Learn more about Anaconda Support".

image

  1. Verify the installation result. You can select the following results to verify whether the installation is successful:

In fact, the installation process is all the way to next. Is it very simple? Don't check to add it to the environment variable. After the installation is complete, you can see the following on the start interface:

image

At this time, we can right-click Anaconda Prompt in the start interface Anaconda Prompt to open the terminal or type conda list in the command prompt to view the contents of your installation as shown below:

image

11. If there is an error in the installation, you can use Uninstall-Anaconda3.exe in the command line cmd to uninstall and reinstall

Environment configuration

Configuration

If it is Windows, you need to go to Control Panel\System and Security\System\Advanced System Settings\Environment Variables\User Variables\Path to add the Scripts folder of the anaconda installation directory, for example, my path is D:\Anaconda3\Scripts

test

Then you can open the command line (preferably open in administrator mode) and enter conda --version

Insert picture description here

If you output a version number such as conda 4.7.10, it means that the environment variable is set successfully.

Change source

Reference article

Enter cmd and enter the following commands in sequence:

conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/conda-forge/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/msys2/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/bioconda/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/menpo/
conda config --set show_channel_urls yes

Configuration Environment

1. Open the Anaconda prompt, enter anaconda-navigator to open anaconda

2. Click environment->click create
environment name in the lower left corner : safehat
python version: 3.6

3. Install the library method

(1) You can search and install directly in anaconda

(2) Use Anaconda prompt

step1: Click to enter the Anaconda prompt

step2: Activate the environment

conda activate

The name of the environment just created

step3:

pip3 install -i
https://pypi.tuna.tsinghua.edu.cn/simple Third-party library name

4. The library and version
opencv-python (cv2) that need to be installed are not required

pillow No requirement

matplotlib no requirement

TensorFlow 2.2.0

TensorFlow-gpu 2.2.0

cudnn 7.6.5

hard 2.3.4

cudatoolkit recommends final
installation (use the statement conda install cudatoolkit to install last because it can automatically match the appropriate version according to the installation of the existing library)

Note: The uninstall statement above is
conda uninstall library name
pip uninstall library name

Run the program

Enter the creation environment, go to the specified folder, and execute the .py file

python file name.py

    --------2020.1.8 18:45

Guess you like

Origin blog.csdn.net/lockhou/article/details/112379138