Module error when executing Python programs

1. encountered in the implementation of python program 'ModuleNotFoundError: No module named' xxxxx '':

E.g:

Picture to import third parties 'requests' module, for example, this error suggesting that no requests module. In python, some

Module is built-in (direct import will be able to use) and some third-party modules, you will need to import use after the completion of the installation, if not

Will be installed directly into the use of the above error! Here are the fastest solution:

1) the need to install third-party module pip (python package tools):

Enter cmd to open the 'pip list' to see which modules are installed:

Here and requests the required module is not installed, then enter:

pip install requests command to install the module requests:

PS: If you use this command has not been successfully installed, check out another article <use About pip command>

Use pip list command again to see if the installation was successful:

You can see a list of which there have been requests that we just installed module

Run the program again, can be used normally requests Modules:

Guess you like

Origin www.cnblogs.com/xsongshu/p/12548409.html
Recommended