vscodeHow to import the python library in the environment? The following article will introduce to you three methods of importing python libraries in vscode. I hope it will be helpful to you!
[Recommended study: "vscode introductory tutorial"]
If the vscode storage location is inconsistent with the code storage location,Personally recommend the first method
The steps are as follows
1. Open vscode and run a string of codes. The specific installation path of python will appear below
, which is the address of the c drive here (the address of the d drive later is where I run Don’t worry about the saving address of the code.
intercept the previous part, that is, C:\Users\Rover\AppData\Local\Programs\Python\Python38-32
2, Open the folder at the corresponding address on your computer, find the Scripts folder, enter it, and you will find a pip.exe, which is the tool used for installation.
Then copy and change the folder address: C:\Users\Rover\AppData \Local\Programs\Python\Python38-32\Scripts
3. Open cmd with win r and enter -cd C:\Users\Rover\ AppData\Local\Programs\Python\Python38-32\Scripts Enter the folder
4. Take installing python-pptx as an example, enter -pip install python-pptx (Just replace it with any library name
5. After the automatic download is successful, the following prompt will appear
End here
Extension: He reminded me to upgrade pip and enter the command python -m pip install --upgrade pipor python.exe -m pip install -- upgrade pip can
Enter the command:
Success!
Enter pip install option in the console (write the name of the imported library, such as import option here)
Refer to this article to install the python library through anaconda
https://blog.csdn.net/Rover95/article/details/113464575?spm=1001.2014.3001.5501
For more knowledge about VSCode, please visit: vscode tutorial! !
The above is the detailed content of How to import python library in vscode? Three ways to share. For more information, please follow other related articles on the PHP Chinese website!