Python 如何将解释器添加到 PyCharm?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/32768371/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How can I add interpreter to PyCharm?
提问by Руслан Шамсудинов
When I try to run code in editor,it says that there is no available interpreters.Please,help.How can I solve the problem?
当我尝试在编辑器中运行代码时,它说没有可用的解释器。请帮助。我该如何解决这个问题?
回答by RataDP
Just read the PyCharm's Docs.
只需阅读 PyCharm 的文档。
https://www.jetbrains.com/pycharm/quickstart/configuring_interpreter.html
https://www.jetbrains.com/pycharm/quickstart/configuring_interpreter.html
Step by step:
一步步:
- Go to
Settings
. - Go to the section
Project Interpreter
. - Click on the plus (+)button and select the
Local
option. - Search for the interpreter, in Linux it is used to be in
/usr/bin/python
or/usr/bin/pythonX.Y
where X and Y are the version. In Windows, it is used to be inC:\python
. - Last step save the settings and you have configured the interpreter.
- 去
Settings
。 - 转到 部分
Project Interpreter
。 - 单击加号(+)按钮并选择该
Local
选项。 - 搜索解释器,在 Linux 中它用于 in
/usr/bin/python
或/usr/bin/pythonX.Y
其中 X 和 Y 是版本。在 Windows 中,它曾经在C:\python
. - 最后一步保存设置,您已经配置了解释器。
PD: If you are on Linux python is installed and if you are using Windows, you can download from here: https://www.python.org/downloads/windows/
PD:如果你在 Linux 上安装了 python 并且你使用的是 Windows,你可以从这里下载:https: //www.python.org/downloads/windows/
回答by ShawnZhu
This page Configuring Python Interpretertells all the information you need.
这个页面配置 Python 解释器告诉你需要的所有信息。
To configure Python virtual environment, follow these steps:
要配置 Python 虚拟环境,请按照下列步骤操作:
回答by Chuze
I think it's better to run this command
我认为最好运行这个命令
$ sudo apt-get install python3-distutils
$ sudo apt-get install python3-distutils