Installing PyCharm
Running into issues? Post on ed. Please make your post visible to all so that other students can learn from the answer.
In Code in Place, you will be writing your code on your computer using an application called PyCharm. PyCharm is what is known as an IDE, or Integrated Development Environment, which means that it allows us to edit our code, browse our files, run our programs and debug them, all in the same place. It’s one of the most popular Python IDEs in the world, and used extremely commonly in industry. This handout is intended to take you through installing PyCharm on your own computer.
Installing Python
In order to be able to run Python programs on your computer, you need to install a Python Interpreter. An interpreter is a program that is capable of reading a .py file that you have written, and translating the Python code in that file to instructions that your computer can easily execute. Begin by downloading Python:
- Mac Installer
- Windows 64-bit installer (If you’re using a relatively new Windows computer, download this file)
- Windows 32-bit installer (If you’re using an older Windows computer, download this file)
Installing Python on a Mac
Macs come with a version of Python installed, but this is an older version of Python. CS 106A requires the use of the newest version of Python, so make sure to follow these instructions even if you think you already have Python installed. To install Python, simply open the downloaded installer file and follow the default instructions.
Installing Python on Windows
Open the downloaded file. Before installing, there should be an option that says «Add Python 3.8 in PATH». Make sure to check this box. Then, continue installing normally.
Installing and Testing PyCharm
Installation
To get started, download and install the community version of PyCharm:
- Mac Download (Open the downloaded .dmg file and drag PyCharm into your Applications folder)
- Windows Download (Open the downloaded .exe file and install PyCharm, using all the default options.)
At the end of the PyCharm installation process, you will be taken to a welcome screen that looks like this:

Click ‘Configure’ and then open PyCharm’s settings, like so:

In the Preferences window, click ‘Project Interpreter’, open the dropdown menu, and click ‘Show All’:

In the following Window, click the plus icon in the bottom left corner:

Click ‘System Interpreter’ in the sidebar. Depending on whether you’ve installed other versions of Python before, Python 3.8 may already be selected in the dropdown menu. If not, select Python 3.8 and then click ‘OK’ and ‘OK’ again:

You should now be on a window that looks like this (although the contents of your list might look different):

Click ‘OK’ again to be taken back to the welcome page. You’re now ready to test PyCharm!
Testing PyCharm
PyCharm models a program as a ‘project’, which consists of one or more Python files, as well as any additional resources like images or text files. To get you familiar with working with and running progams in PyCharm, we’ve provided a sample project, which you can download here. To test out this project, and to gain familiarity with the PyCharm environment, download the sample project (on Windows, you’ll need to manually unzip it by opening it in Windows Explorer and selecting ‘Extract All’) and open it in PyCharm (using the ‘open’ option on the first screen). Whenever you open projects in PyCharm, open the folder directly containing the files you want to edit as opposed to just the files themselves. Upon opening the project, you should be greeted by a window that looks like this:

Click ‘Project’ in the top left or use the Command + 1 shortcut to open the file explorer, and open intro.py to pull up the editor:

You aren’t required to read or understand this code (although you will be able to by the end of the quarter!) but note that this editor is where you’ll be writing all your code this quarter. Now, to run your program, click ‘Terminal’ in the bottom left corner, which will pull up a new terminal pane in your PyCharm window:

We’ll talk more about the terminal later in the quarter, but for now, know that the terminal is how you’ll be running your Python programs throughout the quarter. To run your first Python program, type this into the terminal and press enter:
You should see output that looks like this:

Now, type the following command into the terminal:
For example, if your name is Brahm, you’d type python3 intro.py Brahm . You can type your full name if you’d prefer. You should now see output like this:

Congratulations! You’re now done with the PyCharm setup process.
Frequently Asked Questions
Can I use another version of Python?
Our strong recommendation is to use Python 3.8, which can be installed in parallel with other versions of Python. This is the only version of Python we’ll be supporting in this class. You must use at least Python 3.6.
Can I use an editor that isn’t PyCharm?
If there’s another environment that you’re more comfortable with, you may use it, but the course staff will only provide support for issues in PyCharm. You must not modify any configuration files provided in assignment starter code.
When I try to run my code, I’m getting an error saying can’t open file intro.py: No such file or directory ! What does this mean?
This most often happens when you open the incorrect file or folder in PyCharm. In this case, make sure to open the pycharm_intro folder that directly contains intro.py , rather than intro.py itself or a folder containing pycharm_intro . On Windows computer, you may have a folder called pycharm_intro with another folder inside it called pycharm_intro . Make sure to open the inner folder.
To correct this error, open the ‘File’ menu and click ‘Open’. Then, navigate to the correct pycharm_intro folder and open it.
To verify that you are in the correct folder, type ls (that’s a lowercase ‘L’) dir into your terminal (the same place you type python3 intro.py < YOUR NAME HERE > ). This will show you a list of all the files in that folder, and intro.py should be in this list.
I’m getting a ‘No Python Interpreter configured for the project’ message when I open a file! What should I do?
This is likely caused by an issue with how you set up the interpreter. To fix this, click ‘Configure Python Interpreter’, and set up the interpreter by following these steps until the ‘Testing Pycharm’ section.
I’m on a Mac and I’m getting a message saying The default interactive shell is now zsh. To update your account to use zsh, please run `chsh -s /bin/zsh . What should I do?
That’s just an innocuous message, don’t worry about it!
I’m on a Mac and PyCharm won’t open! What should I do?
You might be using a slightly older version of MacOS. Try installing this version of PyCharm instead.
I’m getting an error window saying «This installation contains JetBrains Runtime 11 which does not support Microsoft Windows 32-bit version»! What should I do?
Try installing this version of PyCharm instead.
Course FAQs will be updated as we receive questions.
© Stanford 2020 | CS106A has been developed over decades by many talented teachers. Website designed by Chris Piech.
Пытаясь заставить PyCharm работать, продолжайте получать «Не выбран интерпретатор Python»
Я пытаюсь изучить 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 , потому что ваш интерпретатор находится на этом компьютере.
Pycharm: "No Python interpreter configured for the project" everytime
No Python interpreter configured for the project.
So I set the interpreter, everything works fine, then I close PyCharm and reopen it, and the message pops up again.
Reinstalling Python and Pycharm didn’t fix the problem.
![]()
3 Answers 3
One way you could try is: Run —> Edit Configurations —> set your interpreter there. That «sticks» for me.
If you are opening individual files then try setting the default settings.
File > Default Settings > Project Interpreter.
I think when you are opening individual files you are not loading the project. This sets a default interpreter so opening a file without loading the project should give it this interpreter.
If this doesn’t work then open pycharm normally and select the project that you are working on.
[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.
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:\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\

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.