如何设置默认PyCharm解释器? [英] How to set default PyCharm interpreter?

查看:5363
本文介绍了如何设置默认PyCharm解释器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的PyCharm安装有两个解释器可用:




  • Python 3.3.2(/usr/bin/python3.3m )

  • Python 2.7.5(/usr/bin/python2.7)



项目它将解释器设置为Python 3.由于我主要使用2.7,这意味着在大多数情况下,我必须重新配置它。

更新:在文件中将默认解释器设置为Python 2.7.5后,如何将其更改为在新项目中默认使用2.7? →默认设置→项目解释器并删除 .idea / misc.xml 文件,解释器现在在misc.xml中未设置。比设置为Python 3.3,但仍然...

解决方案

文件 | 默认设置 | 项目解释器



此配置为新项目设置默认解释器,注意默认设置菜单,它不同于文件 | c 设置当前项目的选项。



,您可以从欢迎屏幕配置 | 设置)。



请注意,它会影响打开目录选项。一旦使用文件打开目录,将使用您使用上述步骤配置的默认解释器创建一个新项目。 新建项目选项将按默认顺序显示已配置的解释器列表,您必须选择要使用的解释器。有相关请求可首先建议最常用的翻译。


My PyCharm installation has two interpreters available:

  • Python 3.3.2 (/usr/bin/python3.3m)
  • Python 2.7.5 (/usr/bin/python2.7)

Whenever I open a new project it sets the interpreter to Python 3. Since I work mostly with 2.7, this means in most cases I have to reconfigure it. How do I change it to use 2.7 by default for new projects?

Update: After setting the default interpreter to Python 2.7.5 in File → Default Settings → Project Interpreter and removing the .idea/misc.xml file, the interpreter is now not set at all in misc.xml. Better than setting it to Python 3.3, but still...

解决方案

File | Default Settings | Project Interpreter.

This configuration sets the default interpreter for the new projects, note the Default Settings menu, it's not the same as File | Settings which sets options for the current project.

If there is no open project, you can access this menu from the Welcome Screen (Configure | Settings).

Please note that it affects Open Directory option. Once you open a directory with your files, a new project will be created with the default interpreter that you have configured using the above steps. New Project option will show you the list of configured interpreters in default order and you will have to choose which one to use. There is a related request to suggest the most frequently used interpreter first.

这篇关于如何设置默认PyCharm解释器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆