Sometimes when we use Python to program in Python, we need to import a large number of third-party libraries. How can we set it to automatically import third-party libraries? We don’t need to use the command line to import manually. We can use shortcut keys to import quickly. Let’s take a look at the detailed setting methods.
JetBrains pycham Pro 2021.2.1 professional edition Chinese portable green Enhanced Edition (with method)
- Type:Programming tools
- Language:Simplified Chinese
Open pycharm on our computer and you can see the input here“import requests”Burst red,Represents that the request third-party library has not been importedAs shown in the figure below:
We slide the mouse to“import requests”When near, press“Alt + enter” keyAs shown in the figure below:
Press“alt+enteAfter the “R” key, select“Install Package requests”Automatically import the third-party library, as shown in the following figure:
You can see that the third-party library has been imported and the program has been successfully run, as shown in the figure below:
We can also enter at the command prompt“pip install requests“Manually import the third-party library, as shown in the following figure:
The above is how pycharm can automatically import third-party libraries. I hope you like it. Please continue to pay attention to developeppaer.