Khắc phục lỗi no python interpreter configured for the project
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
In the Interpreter drop-down, select one of the Python interpreters that have been installed in your system, or click and in the Select Python Interpreter dialog that opens, choose the desired Python executable. You 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:
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 Python Interpreter setting shows that 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 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 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 ( When you create a new Python virtual environment and select it as Python Interpreter in your project settings, |