No python interpreter configured for the project
is a common error message you may encounter in PyCharm. PyCharm is a very useful editor having nice features like debugging, testing, refactoring and code completion. However, it needs an external interpreter (Python.exe) to run Python code.
This message tells you that project configuration should be updated to use a valid Python installation. To open the related configuration, you can click on Configure Python interpreter
link as shown below. Or alternatively, you can select File -> Settings from the menu and open Project -> Python Interpreter setting.
Python Interpreter setting shows that <No Interpreter> is selected for the project. To select (or create) a Python.exe interpreter click on Gear icon and select Show All… option.
In the Python Interpreters window that opens, the list is empty. To add a new Python Interpreter click on Plus (+) icon.
In Add Python Interpreter window, you can create a new virtual Python environment. My project is under C:abcstudyguidepython
directory, so I have created a folder venv
under this directory to create a new virtual environment for my project.
You must then choose a Base interpreter. Base interpreter is the python.exe file installed on your system. When you create a virtual environment, it will be based on Python version specified here. If you need a specific version of Python (like 3.8, 3.7), you need show path of this Python version in Base interpreter filed.
If you don’t have Python installed on your system yet, you can download it from https://www.python.org/downloads/. Note that I installed Python in C:PythonPython39
directory on my computer. However, default installation path is C:Users{YourUserName}AppDataLocalProgramsPython
.
Virtual Environments in Python
Instead of creating a new virtual environment, you can also use the System Interpreter, but this method is not recommended.
You can work on many different Python projects. Virtual environments are useful for creating an isolated environment for each Python project. Consider you are working on two different projects (ProjectA and ProjectB). Both projects are using the same library (LibraryX) but they require different versions of LibraryX. ProjectA needs version 1.0 of LibraryX, ProjectB needs version 2.0.
To avoid version conflicts between third party libraries, each project should create and use its own virtual environment instead of using System Interpreter (C:PythonPython39python.exe
).
When you create a new Python virtual environment and select it as Python Interpreter in your project settings, No python interpreter configured for the project
message will be gone.
106 / 94 / 66 Регистрация: 21.04.2014 Сообщений: 1,337 |
|
1 |
|
Подключить интерпретатор21.01.2020, 20:08. Показов 57698. Ответов 1
Здравствуйте.
0 |
Programming Эксперт 94731 / 64177 / 26122 Регистрация: 12.04.2006 Сообщений: 116,782 |
21.01.2020, 20:08 |
Ответы с готовыми решениями: Интерпретатор в ОС Java Интерпретатор python Интерпретатор кода на Python Интерпретатор для PyCharm 1 |
19 / 14 / 6 Регистрация: 21.01.2020 Сообщений: 49 |
|
22.01.2020, 17:17 |
2 |
Когда интерпретатор не добавлен, выглядит всё примерно так: Вы должны нажать Ctrl+Alt+S для вызова настроек. В настройках необходимо выбрать слева Project Interpreter, далее справа от строки с таким же названием Project Interpreter нажать на шестеренку и выбрать Add Откроется окошко в котором нужно нажать ОК(если как вы говорите в консоли питон работает, значит Pycharm должен подхватить интерпретатор сам) Далее тоже ОК Спустя несколько секунд в правой нижней части увидите версию интерпретатора, можно работать
3 |
Я пытаюсь изучить Python и решил использовать PyCharm. Когда я пытаюсь запустить новый проект, я получаю диалог, в котором говорится, что «Нет интерпретатора Python выбрано». У него есть раскрывающийся список, чтобы выбрать интерпретатор, но выпадающий пуст.
8 ответов
Вероятно, ваша проблема заключается в том, что вы не установили python. Это означает, что если вы используете Windows, вы не загрузили установщик для Windows, который вы можете найти на официальном сайте Python.
В случае, если у вас есть, есть вероятность, что PyCharm не сможет найти вашу установку Python, потому что она не находится в местоположении по умолчанию, обычно это C:Python27 или C:Python33 (для меня как минимум).
Итак, если вы установили Python и он все еще дает эту ошибку, то могут произойти две вещи:
- Вы используете virtualenv и этот virtualenv был удален или изменился путь к файлу. В этом случае вам нужно будет найти переход к следующей части этого ответа.
- Ваша установка python не находится по умолчанию, и в этом случае вам нужно будет найти ее местоположение и найти файл python.exe .
После того, как вы найдете необходимые бинарные файлы, вам нужно будет сказать, что PyCharm должны были выглядеть:
- Откройте диалог настроек CTRL + ALT + S
Затем вам нужно будет ввести interpreter в поле поиска:
Как вы можете видеть выше, вам нужно будет перейти к Project Interpreter а затем перейти к Python Interpreter . Местоположение выбрано для вас на приведенном выше изображении.
В стороне вы увидите несколько опций в виде значков, щелкните значок «Большая + , затем нажмите » local , потому что ваш интерпретатор находится на этом компьютере.
Как это исправить? «Ошибка: выберите допустимый интерпретатор Python»
Зайдите в Run-> Edit configurations затем выберите расположение интерпретатора Python для установленного Python ( python.exe ) затем после изменения примените изменения.
.
У меня была такая проблема. Я изменил имя своего модуля, но старое имя все еще сохранялось кое-где. Я исправил это в плагине Python для IntelliJ IDEA — удалил старый модуль и воссоздал его из источников — а затем он работал в PyCharm. Возможно, это можно было бы исправить в PyCharm, я просто переключал IDE из-за разочарования.
how to fix this ? «Error: Please select a valid Python interpreter»
Go to run->Edit configurations then select Python interpreter location of the python installed ( python.exe ) then after change apply the changes.
.
I had this problem. I had changed the name of my module, but the old name still persisted here and there. I fixed it in the Python plugin for IntelliJ IDEA — deleting the old module and recreating it from sources — and then it worked in PyCharm. It might have been possible to fix it in PyCharm, I was just switching IDEs out of frustration.
In any stage, while doing python programming in Pycharm, we can encounter this error — “No python interpreter configured for this project.”
This error usually occurs when you are programming in Python and particularly using PyCharm IDE. To solve this error first you have to know what is Python and PyCharm.
Python is an interpreter that can be used to execute the python code
PyCharm is an integrated development environment used in computer programming, especially for the Python programming language(though other languages are also supported) that can display the output of your python programs in the console with the help of the installed python interpreter. PyCharm provides some best features to its users and developers in the following aspects.
- Code completion and inspection
- Advanced debugging
- Support for web programming and frameworks such as Django and Flask.
Now let’s come back to the solution.
Step 1: In the PyCharm window you can see the option of “Configure Python Interpreter” in the upper right corner.
Step 2: Click on this «Configure python interpreter» option. A settings window will appear in which the project interpreter will open.
You can also open a Project interpreter from the File option.
Go to File -> Settings -> Project -> Project Interpreter.
Step 3: In the “Project Interpreter” menu, you will get an option of selecting the project interpreter. I have a Python 3.6 project interpreter option because I am working with Python 3.6. Sometimes, there will be no option for a project interpreter. The reason can be either you have not installed python or your PyCharm is unable to locate a valid Python interpreter.
Step 4: Sometmies, you will not see a python interpretor in the dropdown, which means we need to guide pyhcharm on where the python interpreter is installed. To solve for this problem you can simply click on the “gear icon”.
Step 5: Click on “Add”.
Step 6: After this click on the “Existing Environment”.
Step 7: Then click on the “triple-dot” icon to locate python on your computer.
Note: You can follow the above steps only if you have installed python on your computer.
Step 8: If you don’t have Python then download and install it.
Now how to download and install python?
- Go to “Google Chrome”.
- Write “python install”.
You will find the home page of python.org. Here click on “Download Python 3.6.5” to download python.
Download the python interpreter and install it.
Step 9: 90% of the times, a python interpreter can be located automatically as was in my case. If you are able to find the python interpreter option in the dropdown, select and click on it.
Step 10: Click on the “Apply” button.
Step 11: Click “Ok”.
Now you can see that error is gone and you can happily work with your pycharm.
Step 12: After this, run any of your programs and the corresponding output will show up in the console.
I hope this article was helpful and you were able solve your error. Happy Coding!
You can also watch the following video if any of the above-mentioned steps are unclear. I am 100% sure that you will be able to solve error after following the instructions given in this article.