The command to install the library in Python

The command to install the library in Python

1. Virtual Environment

  1. View the currently existing virtual environment:

    conda env list
    
  2. Create a new virtual environment:

    conda create -n test python=3.8	#	(包名为test)
    
  3. Open the created environment:

    conda activate test (此处我建的环境名字是test)
    
  4. View existing packages in the environment:

    pip list
    
  5. Activate the virtual environment:

    activate test(虚拟环境名称)
    
  6. Exit the virtual environment:

    deactivate env_name
    
  7. Switch back to the root environment:

    activate root
    
  8. Delete the virtual environment:

    conda remove -n test(虚拟环境名称) --all
    
  9. Remove the package in the virtual environment:

    conda remove --name $your_env_name $package_name(包名)
    
  10. Restore the configuration of the mirror source:

    conda config --remove-key channels
    
  11. Reconfigure the image:

    conda config --add channels https://repo.continuum.io/pkgs/free
    
    conda config --add channels https://repo.continuum.io/pkgs/main/
    
    conda config --set show_channel_urls yes
    
  12. View configuration information:

    conda config --show channels
    
  13. Terminate installation: Ctrl + c

  14. Upgrade the pip package:

    pip install -U pip  
    pip install --upgrade pip
    
  15. View information about a package:

    pip show -f package_name(package_name换成想查看包的名字)
    
  16. View information about packages that need to be upgraded:

    pip list -o
    
  17. Check compatibility issues: When downloading and installing some standard libraries, you need to consider compatibility issues. The installation of some standard libraries may depend on other standard libraries, and there may be problems such as version conflicts. Let’s first use the following command line to check Let's see if there is a conflict problem:

    pip check package_name(package_name换成想查看包的名字)
    
  18. If no standard library is specified, all installed packages are checked for conflicts:

    pip check
    
  19. Download a package without installing it:

    pip download package_name  -d  '某个路径'
    

    ​ eg: pip download torch -d '.' Explanation: Download the torch package and all the modules it depends on in the current directory

2. Install labelme

Use anaconda to download labelme's tutorial:

  1. Create an anaconda virtual environment: Note: the environment name is labelme, and it can also be replaced with another:

    conda create -n labelme python=3.8
    
  2. Activate the environment:

    conda activate labelme
    
  3. The dependent environment required to install lableme:

    conda install pyqt
    conda install pillow
    

  4. Install the labelme package:

    pip install labelme==3.16.2
    

    注意:conda安装命令如果出错也可以使用pip命令,使用逻辑等号"=="

  5. Use labelme to label pictures: enter labelme in the window just installed to open labelme

3. Commonly used mirror sources

Tsinghua:https://pypi.tuna.tsinghua.edu.cn/simple

Ali Cloud:http://mirrors.aliyun.com/pypi/simple/

Douban:http://pypi.douban.com/simple/

University of Science and Technology of China:https://pypi.mirrors.ustc.edu.cn/simple/

Huazhong University of Science and Technology:http://pypi.hustunique.com/

Shandong University of Technology:http://pypi.sdutlinux.org/

4. How to download web version video

Open python, enter the virtual environment containing you-get (my virtual environment name is labelme), and execute the command:

python -m pip install –upgrade pip

pip install –upgrade you-get

you-get video link, just press enter.

5. Steps to download jupyter notebook:

  1. Enter in the conda interface:
pip install jupyter notebook
  1. Open jupyter notebook:
jupyter notebook
  1. Open a specific notebook:
jupyter notebook notebkko.ipynb

6. Install torch and Cuda

  • Command to update pip:
python -m pip install --upgrade pip

URL to download CUDA:https://developer.nvidia.com/cuda-toolkit-archive

  • The command to verify whether cuda is successfully installed:
nvcc -V

Pytorch official image (if you can’t download it from the Internet, just download it here first, and then install it offline):https://download.pytorch.org/whl/cu116

  • Tsinghua University open source software mirror site:https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/

  • Pytorch finds the URL of the cuda command:https://pytorch.org/get-started/locally/

Find the corresponding command:

pip install --pre torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/nightly/cu116

Note: The 3 in the original pip3 is removed because there is no python2 version on the computer, so there is no need to add 3

  • -c: Specify to install through a channel

Note: The official image must be used to install with pip, and other installations can be used for conda.

  • Check if cuda and torch are installed:

First enter: python, press Enter

then:

python
import torch
print(torch.__version__)			# 注意:version的前后都是两个下划线_
print(torch.cuda.is_available())	# is后面一个下划线

7. Install the apex package:

git clone https://github.com/NVIDIA/apex
cd apex
pip install -v --no-cache-dir ./

8. Install rasterio and GDAL

To download the URL of rasterio, you need to download its dependent library GDAL first :https://www.osgeo.cn/rasterio/installation.html

9. View GPU usage

Command window (cmd) input:

nvidia-smi

Release process:

taskkill -PID 进程号 -F
如:taskkill -PID 10234 -F

10. Netron view the structure of the network model

URL: https://github.com/lutzroeder/netron/releases/tag/v5.9.2

Netron is a viewer for neural network, deep learning and machine learning models.

Netron Market ONNX, TensorFlow Lite, Caffe, Keras, Darknet, PaddlePaddle, ncnn, MNN, Core ML, RKNN, MXNet, MindSpore Lite, TNN, Barracuda, Tengine, CNTK, TensorFlow.j s、Caffe2 and UFF。

Netron provides experimental support for PyTorch, TensorFlow, TorchScript, OpenVINO, Torch, Vitis AI, kmmodel, Arm NN, BigDL, Chainer, Deeplearning4j, MediaPipe, ML.NET, and scikit-learn.

11. Plug-in iguge to speed up downloading foreign data

iguge URL: http://iguge.xyz/

12. Install the dlib library

1. Download the dependencies: cmake, boost, C++ compiler

2. Reference address: http://dlib.net/compile.html

After installing the relevant dependencies:

pip install dlib --verbose

or

After downloading offline, go to the base folder of the dlib repository and run

python setup.py

Just install it.

13. Install paddle and EISeg

1. Create a new virtual environment and install the paddle framework separately

2. Install the CPU version:

pip install paddlepaddle

Install the GPU version:

pip install paddlepaddle-gpu

You can go to the official website to check the cuda version, corresponding to the installation: https://www.paddlepaddle.org.cn/install/quick?docurl=/documentation/docs/zh/install/pip/windows-pip.html

3. Install EISeg

pip install eiseg

4. Open EISeg

eiseg

python setup.py


安装即可。

## 13、安装paddle和EISeg

1、新建一个虚拟环境,单独安装paddle框架

2、安装CPU版本:

pip install paddlepaddle


安装GPU版本:

pip install paddlepaddle-gpu


可以去官网查看cuda版本,对应安装:https://www.paddlepaddle.org.cn/install/quick?docurl=/documentation/docs/zh/install/pip/windows-pip.html

3、安装EISeg

pip install eiseg


4、打开EISeg

icy


Guess you like

Origin blog.csdn.net/Miss_croal/article/details/128943678