How to import python library in vscode 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 learning: vscode tutorial, Programming teaching]
If vscode storage location and code storage When the positions are inconsistent, I personally recommend the first method
Method 1: Configure in the vscode environment
The steps are as follows
1. Open vscode and run a string of codes. The specific installation path of python will appear below.
That is c here The address of the disk (the address of the d disk behind is the save address of my running code, regardless of
intercept the previous part, that is, C:\Users\Rover\AppData\Local\Programs\Python\Python38- 32
2. Open the folder at the corresponding address on the 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 Folder address: C:\Users\Rover\AppData\Local\Programs\Python\Python38-32\Scripts
##5. After the automatic download is successful, the following prompt will appear
End here
He reminded me to upgrade pip, enter the commandpython -m pip install --upgrade pipor python.exe -m pip install --upgrade pip Then
Enter the command:
Success!
Method 2: Import directly into vscode Enter in the console
pip install option (write the imported library name, such as import here option)
Method 3: Use anaconda to import
The above is the detailed content of A brief analysis of three methods of importing python libraries in the vscode environment. For more information, please follow other related articles on the PHP Chinese website!