Pycharm cannot set up a python SDK The solution to the problem
One 、 Question why ( If not for the first time pycharm, I think we can skip this chapter )
Get into Pycharm after , Open previous projects , open Pycharm→file→settings→project interpreter, According to the picture below 1 After selecting configuration , Click on 【OK】 There will be an error , Pictured 2
Two 、 terms of settlement
Modify what you want to use venv Profile under folder , The file is as follows
have access to Notepad++ Open the above configuration file 【pyvenv.cfg】 Modify the configuration in the configuration file python Startup path , You can refer to my configuration file , As shown below
Modify the path in the red box in the figure , My profile is for reference only , Some people have only one configuration file home Is to configure the path , Then you only need to modify one ; Put them == Change it to your python The installation path ==,
You have a few wrong python Just modify the path .
Give me python Installation path for reference
One 、 Question why ( If not for the first time pycharm, I think we can skip this chapter )
I was upgraded , In use pycharm When you open a previous project, an error is reported ; Obviously, the environment information is not configured correctly ; The following error messages appear when modifying the environment configuration
Get into Pycharm after , Open previous projects , open Pycharm→file→settings→project interpreter, According to the picture below 1 After selecting configuration , Click on 【OK】 There will be an error , Pictured 2
There are many previous packages in my environment , So this place I chose to use the previous venv Environmental Science , Dare not empty . chart 1
chart 2 In addition to this , There will also be an error report Can't find D:\Python3.10.1\python What is the (103)
Two 、 terms of settlement
Modify what you want to use venv Profile under folder , The file is as follows
have access to Notepad++ Open the above configuration file 【pyvenv.cfg】 Modify the configuration in the configuration file python Startup path , You can refer to my configuration file , As shown below
Modify the path in the red box in the figure , My profile is for reference only , Some people have only one configuration file home Is to configure the path , Then you only need to modify one ; Put them Change it to your python The installation path ,
You have a few wrong python Just modify the path .