There are currently three solutions that have also been personally tested to work:
The first method:
Because some libraries have been added through the + sign in pycharm's project interpreter, but the added libraries are only for the specified project, and if you want to use them, you have to use the python interpreter of the previous project, as an example:
This is the interpreter of my previous project, this project interpreter is inherited from the python interpreter, and at the same time installed these libraries you see above, including numpy and opencv-python, etc., and then I create a new project:
The project's interpreter is this one, and it doesn't have the numpy and opencv libraries I installed before. Just replace it with the interpreter of the previous project and it will automatically load the third-party libraries installed in the previous project. The result is as follows (note the path to my interpreter)
This will allow you to use the python third party libraries that you downloaded earlier, not sure if that makes sense.
The second method:
Add the path to the python site-package used by the project, this also solves the problem of why cmd can sometimes import some libraries, while pycharm does not import the problem of no moudule will be reported, in fact, it is still a problem of the environment variable.
Click on Set Parameters
Add a PYTHONPATH path inside the environment variable
This path can be found via cmd, because it's all said and done that cmd can find this globally installed library, but pycharm can't find it
Just fill in this path: H:\library\python\lib\site-packages
In fact many libraries add path information here after installation so that you can find the installed library.
The third method:
If you're installing libraries that are piped into site-packages, you can actually just inherit them
Tap Interpreter, Add
Just put a checkmark on the "inherit global site-packages" box and you're good to go.
Summary:
The above methods can be solved with one, the first method is to rely on the third library installed internally by pycharm, which only needs to be installed once, and then indexed to the interpreter after this inheritance every time in the future, but the libraries used in this way are not using the libraries installed through the global installation of good libraries.
The second method essentially adds globally installed libraries (installed via pip)
The third method I added later and I think it's the best way to do it without the hassle and understanding the interpreter inheritance in this case
Note:One thing is very strange this python path is clearly H:\library\python\Lib\site-packages but with the cmd print out the lowercase lib, do not know why this is, but no matter with the print shall prevail on the right.
Above this to solve pycharm each time a new project to reinstall some third-party libraries is all I have shared with you, I hope to be able to give you a reference, and I hope you will support me more.