Pycharm ошибка no python interpreter configured for the project

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.

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.

109 / 96 / 67

Регистрация: 21.04.2014

Сообщений: 1,373

1

Подключить интерпретатор

21.01.2020, 20:08. Показов 64377. Ответов 1


Студворк — интернет-сервис помощи студентам

Здравствуйте.
Впервые в жизни решил познакомиться с Python. Немного погуглив понял, что в своей Ubuntu я могу без особых проблем писать код прям в стандартном текстовом редакторе, что я и делал. Работает, файлы исполняются. Но так как стандартный текстовый редактор несколько ограничен, то стал выбирать себе IDE. Выбор пал на PyCharm. Поставил, включил, создал проект, добавил Python файл и получил «No Python interpreter configured for the project». Ну т.е. интерпретатор она не видит. Нашёл в настройках где его задавать, а список пуст. Не понимаю как это так. Я ведь успешно исполняю написанное в текстовом редакторе. Если написать в терминале «python3 —version», то в ответ будет «Python 3.7.5». Ну т.е. он есть.
Как сделать так, чтобы PyCharm его увидела? Если я что-то очень сильно не так понял, пожалуйста, объясните.



0



19 / 14 / 6

Регистрация: 21.01.2020

Сообщений: 49

22.01.2020, 17:17

2

Когда интерпретатор не добавлен, выглядит всё примерно так:

Подключить интерпретатор

Вы должны нажать Ctrl+Alt+S для вызова настроек. В настройках необходимо выбрать слева Project Interpreter, далее справа от строки с таким же названием Project Interpreter нажать на шестеренку и выбрать Add

Подключить интерпретатор

Откроется окошко в котором нужно нажать ОК(если как вы говорите в консоли питон работает, значит Pycharm должен подхватить интерпретатор сам)

Подключить интерпретатор

Далее тоже ОК

Подключить интерпретатор

Спустя несколько секунд в правой нижней части увидите версию интерпретатора, можно работать

Подключить интерпретатор



3



Show

Course Contents

[Solved] The term ‘pip’ is not recognized as the name of a cmdlet, function, or operable program

No python interpreter configured for the project’ in Pycharm

Вероятно, ваша проблема заключается в том, что вы не установили python. Это означает, что если вы используете Windows, вы не загрузили установщик для Windows, который вы можете найти на официальном сайте Python.

В случае, если у вас есть, есть вероятность, что PyCharm не сможет найти вашу установку Python, потому что она не находится в местоположении по умолчанию, обычно это C:Python27 или C:Python33 (для меня как минимум).

Итак, если вы установили Python и он все еще дает эту ошибку, то могут произойти две вещи:

  1. Вы используете virtualenv и этот virtualenv был удален или изменился путь к файлу. В этом случае вам нужно будет найти переход к следующей части этого ответа.
  2. Ваша установка python не находится по умолчанию, и в этом случае вам нужно будет найти ее местоположение и найти файл python.exe.

После того, как вы найдете необходимые бинарные файлы, вам нужно будет сказать, что PyCharm должны были выглядеть:

  1. Откройте диалог настроек CTRL + ALT + S
  2. Затем вам нужно будет ввести interpreter в поле поиска:

    Изображение 121464

  3. Как вы можете видеть выше, вам нужно будет перейти к Project Interpreter а затем перейти к Python Interpreter. Местоположение выбрано для вас на приведенном выше изображении.

  4. В стороне вы увидите несколько опций в виде значков, щелкните значок «Большая +, затем нажмите » local, потому что ваш интерпретатор находится на этом компьютере.

  5. Это откроет диалоговое окно. Обязательно выберите файл python.exe этого каталога, не дайте pycharm весь каталог. Он просто хочет переводчика.

Понравилась статья? Поделить с друзьями:
  • Pxe m0f ошибка на ноутбуке
  • Pxe e61 ошибка на ноутбуке
  • Pwm9142 05 ошибка гидравлической системы
  • Pvz heroes ошибка подключения к сети как исправить
  • Pvz 3 ошибка 004 4010