Commonly used for beginners in python, several methods for installing and uninstalling python modules

Brothers often fail to install modules when they encounter modules, or get confused when they encounter errors, which delays the learning progress. Today, we will learn about several methods of installing modules in Python at one time~
But~

I'm really too lazy to look at it. Click here to ask the administrator to teach you how to install it.

know everything

First, the command prompt window installation and uninstallation

1. Installation

The first, the most commonly used method, is basically used by beginners, and it is installed directly in cmd.

First, press and hold win+r on the keyboard
Please add image description
, and the run box will pop up,
Please add image description
then enter cmd and
Please add image description
press OK, and then the command prompt window will pop up.
Please add image description
Let's take the common module requests of crawlers as an example, requests is a data request module.

Enter pip install requests in the command prompt window to install successfully.
Please add image description
The last sentence is to prompt the successful installation of the requests module of version 2.27.1.

Note: pip is a Python package management tool that provides functions for finding, downloading, installing, and uninstalling Python packages.

2. View the installation

Let's check the installation, enter pip list and press Enter to view, pip list is to check which third-party libraries are installed in Python.
Please add image description
Freeze press Enter to view, pip freeze is to view all modules installed. Please add image description
Or the list looks refreshing, and if there is no need to use freeze, we can just use the list.

3. Uninstall

Or take requests as an example

Enter pip uninstall requests in the command prompt window and press Enter
Please add image description
Enter Y to agree to uninstall, enter n to disagree to uninstall, here we enter Y.

Please add image description
Seeing that Successfully is the currently installed version 2.27.1 has been uninstalled.

There are also two uninstall methods, but I personally feel that the use is not that big, and I will write it up to make up the number of words, so I will not write it.

2. Install and uninstall through pip in pycharm

This is similar to the first one, but if you are typing code with pycharm, it is more convenient and you don't need to open so many windows.

1. Installation

First open pycharm, then see the terminal in the lower left corner and
Please add image description
click the terminal to pop up this interface.
Please add image description
The rest is the same as in the command prompt window.

Enter pip install requests and press Enter to install
Please add image description
2. Uninstall

Enter pip uninstall requests and press y to complete the uninstallation
Please add image description

3. Install and uninstall in pycharm settings

This is relatively simple, but many people don't use it.

1. Installation
First open pycharm, click file, click settings,
Please add image description
click plugins, click marketplace, click the search box, and enter the module you want to install.
Please add image description
Requests is used as an example.

Click install to install successfully
Please add image description
Please add image description
Click installed to view the installation, you can see the picture below, here we have successfully installed.
Please add image description
2. Uninstall

Uninstallation is easier, just click Restart IDE behind the module to complete the installation.
Please add image description
Then click restart to restart pycharm
Please add image description

Brothers, this is not allowed to like, forward, and collect?

Please add image description

Guess you like

Origin blog.csdn.net/m0_67575344/article/details/124299819