PyCharm 2022.2 Help

Create a Python project

Pure Python projects are intended for Python programming. A project helps you organize your source code, tests, libraries that you use, and your personal settings in a single unit. In case, you don't need a project, you can edit your file in the LightEdit mode.

  1. To create a project, do one of the following:

    • From the main menu, choose File | New Project

    • On the Welcome screen, click New Project

    New Project dialog opens.

  2. In the New Project dialog, specify the project name and its location. The dialog may differ depending on the PyCharm edition.

    Creating a new project

    Creating a PyCharm helps implement new project

  3. Next, click Expand the node to expand the Python Interpreter node, and select the new environment or existing interpreter, by clicking the corresponding radio-button.

    The following steps depend on your choice:

    • New environment using: if this option has been selected, choose the tool to be used to create a virtual environment. To do that, click the list and choose Virtualenv, Pipenv, Poetry, or Conda.

      Next, specify the Location and Base interpreter of the new virtual environment.

      Select the Inherit global site-packages checkbox if you want that all packages installed in the global Python on your machine to be added to the virtual environment you're going to create. This checkbox corresponds to the --system-site-packages option of the virtualenv tool.

      Select the Make available to all projects checkbox if you want to reuse this environment when creating Python interpreters in PyCharm.

      When configuring the base interpreter, you need to specify the path to the Python executable. If PyCharm detects no Python on your machine, it provides the following options:

      • Specify a path to the Python executable (in case of non-standard installation)

      • Download and install the latest Python versions from python.org

      • Install Python using the Command-Line Developer Tools (macOS only).

      Downloading Python when creating a new project
      Downloading Python when creating a new project
    • Previously configured interpreter: if this option has been selected, choose the desired interpreter from the list, or (if the desired interpreter is not found), click Add Interpreter and choose the interpreter. See Configure a Python interpreter for details.

    Create a main.py welcome script: keep this option selected if you want PyCharm to add the main.py file to your project. This file contains a very simple Python code sample and can be a starting point of your project.

    Welcome script in the Python project

Once you created a project, you can proceed with configuring the project structure.

See more details on creating projects in PyCharm in the video tutorial:

Last modified: 27 July 2022