IDEA solves the problem of how to install packages such as numpy in Python projects

在IDEA中建立了一个Python项目,结果导入包时,发现需要自己安装包。具体的问题如下图所示:

insert image description here

The shortcut is:

  • Click the red line with the mouse and stay there, or click the red line and press Alt+Enter, you can see the picture below: You
    insert image description here
    can install it through this shortcut.

Manual mode (shortcut key: Alt+Ctrl+Shift+S)

  1. Click on File, select Project Structure
    insert image description here
  2. After entering, select SDKs, select Packages, and click +
    insert image description here
  3. Enter the name of the package you want to install, select the corresponding package, the version can be selected or not (the latest version is installed by default)
    insert image description here
  4. Finally click INSTALL PACKAGE, the corresponding package will be downloaded and installed
    insert image description here

The successful effect is as follows:

insert image description here
insert image description here

Guess you like

Origin blog.csdn.net/qq_41714549/article/details/126044532