Pycharm no python interpreters

How To Install Python Interpreter In PyCharm

This article will tell you how to install a python interpreter in the PyCharm project. Before start, you should make sure you had installed python on your system.

1. How To Install Python Interpreter In PyCharm.

1.1 On macOS.

  1. Open PyCharm IDE, I use PyCharm community edition with Anaconda plugin.
  2. Then click the PyCharm —> Preferences… menu item ( macOS) or Window —> Preferences menu item ( Windows OS ).
  3. In the popup Preferences window, click Project: Project-Name —> Project Interpreter menu item at the left panel. Then you can see there is no Project Interpreter that has been selected on the right panel.
  4. Click the Project Interpreter drop-down list on the right panel, then click Show All… item, it will pop up the Project Interpreters dialog window.
  5. There is a default PyCharm python interpreter in the dialog. You can select it as the project python interpreter.
  6. If you want to install another Python interpreter, you can click the plus button ( + ) at the bottom left corner of the Project Interpreters popup dialog window.
  7. Then it will popup Add Python Interpreter window. There list 4 types of python interpreters on the window left side, they are Virtualenv Environment, Conda Environment, System Interpreter, Pipenv Environment. You can select the python interpreter type from the left pane as you need.
  8. After you select one python interpreter in PyCharm, it will list all the modules package and version information that has been installed in that interpreter in the Preferences window, you can code and run your python program with that python interpreter.

1.2 On Windows.

  1. It is similar to macOS, the difference is that you should click the PyCharm File —> Settings… menu item to open the Settings dialog.
  2. The Settings dialog is the same as the Preferences dialog on macOS.
  3. Now you can follow steps 3 – 8 of section 1.1 On macOS to install the Python interpreter.
Читайте также:  Html absolute position right align

Источник

Пытаясь заставить PyCharm работать, продолжайте получать «Не выбран интерпретатор Python»

Я пытаюсь изучить Python и решил использовать PyCharm. Когда я пытаюсь запустить новый проект, я получаю диалог, в котором говорится, что «Нет интерпретатора Python выбрано». У него есть раскрывающийся список, чтобы выбрать интерпретатор, но выпадающий пуст.

8 ответов

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

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

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

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

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

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

  1. Откройте диалог настроек CTRL + ALT + S
  2. Затем вам нужно будет ввести interpreter в поле поиска:
  3. Как вы можете видеть выше, вам нужно будет перейти к Project Interpreter а затем перейти к Python Interpreter . Местоположение выбрано для вас на приведенном выше изображении.
  4. В стороне вы увидите несколько опций в виде значков, щелкните значок «Большая + , затем нажмите » local , потому что ваш интерпретатор находится на этом компьютере.
  5. Это откроет диалоговое окно. Обязательно выберите файл python.exe этого каталога, не дайте pycharm весь каталог. Он просто хочет переводчика.

Спасибо за решение. Я просто хотел сказать, что пользователь должен hide the taskbar on windows , чтобы увидеть кнопку ok 🙂

Здесь нет virtualenv , и python также устанавливается в папку по умолчанию. Все еще была эта проблема. Ответ здесь помог мне понять, где он работает, однако мне пришлось перезапустить pycharm, чтобы внести изменения по какой-то странной причине.

Это не работает с Ubuntu 16.04, PyCharm edition 2017.2.1. В разделе «Интерпретатор проекта» нет даже «Python Interpreters», как показано на скриншоте.

Читайте также:  Неизменяемые типы java это

Источник

Configure a system interpreter

To work with your Python code in PyCharm, you need to configure at least one interpreter. A system interpreter is the one that comes with your Python installation. You can use it solely for all Python scripts or take it as a base interpreter for Python virtual environments.

Configure a system interpreter

  1. Ensure that you have downloaded and installed Python on your computer. Installing Python on Windows from Microsoft Store If you are on Windows, you can download Python from the Microsoft Store and install it as a Python interpreter. Once the Python application is downloaded from the Microsoft Store, it becomes available in the list of the Python executables. Python interpreter installed from the Windows storeNote that interpreters added from the Microsoft Store installations come with some limitations. Because of restrictions on Microsoft Store apps, Python scripts may not have full write access to shared locations such as TEMP and the registry.
  2. Do one of the following:
    • Click the Python Interpreter selector and choose Add New Interpreter .
    • Press Control+Alt+S to open Settings and go to Project: | Python Interpreter . Click the Add Interpreter link next to the list of the available interpreters.
    • Click the Python Interpreter selector and choose Interpreter Settings . Click the Add Interpreter link next to the list of the available interpreters.
  3. Select Add Local Interpreter .
  4. In the left-hand pane of the Add Python Interpreter dialog, select System Interpreter . Adding a system interpreter
  5. In the Interpreter field, type the fully-qualified path to the required interpreter executable, or click and in the Select Python Interpreter dialog that opens, choose the desired Python executable. Selecting the Python executableYou will need admin privileges to install, remove, and upgrade packages for the system interpreter. When attempting to install an interpreter package through an intention action, you might receive the following error message: System Interpreter warning messageAs prompted, consider using a virtual environment for your project.
  6. Click OK to complete the task.

For any of the configured Python interpreters (but Docker-based), you can:

Источник

[Solved] 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.

Читайте также:  Javascript lastindexof in string

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 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:\abcstudyguide\python 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:\Python\Python39 directory on my computer. However, default installation path is C:\Users\\AppData\Local\Programs\Python .

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:\Python\Python39\python.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.

Источник

Оцените статью