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

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

问题描述

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

My PyCharm installation has two interpreters available:

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

每当我打开一个新项目时,它都会将解释器设置为 Python 3.由于我主要使用 2.7,这意味着在大多数情况下我必须重新配置它.如何将其更改为默认用于新项目的 2.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?

更新:在文件 → 默认设置 → 项目解释器中将默认解释器设置为 Python 2.7.5 并删除 .idea/misc.xml 文件后,解释器现在在 misc.xml 中根本没有设置.比将其设置为 Python 3.3 更好,但仍然...

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 |默认设置 |项目解释器.

此配置为新项目设置默认解释器,注意默认设置菜单,它与File不同|Settings当前项目设置选项.

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.

如果没有打开的项目,您可以从欢迎屏幕(Configure | Settings)访问此菜单.

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

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

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天全站免登陆