Pycharm增加新安装Python的路径

Pycharm默认的Python是python2,但是如果代码是python3写的,就需要在pycharm里的project interpreter增加python3

注意,一定要找到Project Interpreter,这里是一定可以添加python3的路径的。而不是在Run -> Edit configuration -> Python interpreter处添加。因为,如果你没有在前者添加Python3, 后者是没有这个选项的。当然,你在Project Interpreter处添加了python3之后,运行时可能还需要再改一下Edit configuration 里面的python interpreter, 把其选为python3

如何找到Project Interpreter,在 File -> default settings 里面。总之一定要找到Project Interpreter,才能正常添加。

原文地址:https://www.cnblogs.com/zhangmingcheng/p/8608126.html