Detailed explanation of python installation/uninstallation module method steps (with detailed illustrations)

In daily work, you will need to install or uninstall Python modules. So I sorted it out. The following article mainly introduces the relevant information about python installation/uninstallation modules. The introduction is very detailed through pictures and texts. Friends who need it can For reference

Take the pygame module as an example

1. Import via pycharm

(1) Just click install package pygame directly

The installation is correct if the following conditions occur

If there is an error, you can try to upgrade the pip file to the latest

(2) Install through python interpreter

Steps: File-Setting-python interprete

click the plus sign

After searching for the pygame module, click install Package

The installation is correct if the following conditions occur

(3) Uninstall

Also select the module to be deleted in Python Interpreter and click the minus sign

When this happens, the uninstallation is complete

2. Install via pip in the terminal

(1) installation

Install modules through instructions pip install pygame, more instructions can be Baidu (specified path, specified version, specified download source)

If this happens, the installation is successful

If you re-enter pycharm, you can use this module

(2) Uninstall

pip uninstall pygameUninstall the module by command

In this case, the uninstallation is successful

3. Install through a third-party python library

Website address:

https://www.lfd.uci.edu/~gohlke/pythonlibs/

My computer is 64-bit and I use a python3.7 interpreter (consistent with cp37)

Find the file you want to install and download it (it may take a long time)

Put this file in the python environment path

Can't find path to find hidden items in settings

(1) Install wheel on the computer first

1

pip install wheel

If the wheel file cannot be installed, update the pip file

1

python -m pip install --upgrade pip

(2) Paste the whl file to find this folder (this folder is your own python environment variable path)

1

C:\Users\16660\AppData\Local\Programs\Python\Python37\Lib\site-packages

(3) Use the following command in the terminal to enter this folder

1

cd C:\Users\16660\AppData\Local\Programs\Python\Python37\Lib\site-packages

(4) Then install this file

1

pip install pygame-2.0.3-cp37-cp37m-win_amd64.whl

Enter pycharm again and you will find that the pygame package is available

(5) Uninstall

1

pip uninstall pygame-2.0.3-cp37-cp37m-win_amd64.whl

The deletion is complete as shown below

Summarize

This is the end of this article about the python installation/uninstallation module method.

click to take

Guess you like

Origin blog.csdn.net/ai520wangzha/article/details/131310225