Creating a Python Project

MindStudio allows you to create, develop, and debug Python projects, and perform remote debugging.

Python Project Creation Method

  1. Navigate to the project creation window.
    • On the MindStudio welcome page, choose Project from the left menu and click New Project on the right.
      Figure 1 Project creation page
    • On the MindStudio project page, choose File > New > Project... from the top menu bar.
  2. In the New Project window, select New Project from the left menu and set project parameters, as described in Table 1.
    Table 1 Project parameters

    Parameter

    Description

    Name

    Project name (user-defined).

    Location

    Default path for saving a project (user-defined). (For users who use MindStudio for the first time, the default value is $HOME/MindstudioProjects)

    Create Git repository: indicates whether to create a Git repository. A repository can be created only after this option is selected.

    Language

    Select Java or Python, or click + on the right to select more. Select Python when creating a Python project.

    Environment

    Select a Python environment. The options are New or Existing.

    Selecting New allows you to add an environment type. Selecting Existing allows you to select an existing interpreter.

    Environment type

    Select an environment type. The options are Virtualenv, Conda, Pipenv, and Poetry.

    Location

    This parameter is available when Environment type is set to Virtualenv or Conda.

    It indicates the location of the new Virtualenv or Conda environment. You can click the folder icon on the right to select a desired location.

    Base interpreter

    This parameter is available when Environment type is set to Virtualenv, Pipenv, or Poetry.

    You can select a basic interpreter from the drop-down list or click ... on the right to select the required Python executable file.

    Inherit global site-packages

    This parameter is available when Environment type is set to Virtualenv.

    If this option is selected, all software packages installed in the global Python on the computer will be added to the virtual environment to be created.

    Make available to all projects

    This parameter is available when Environment type is set to Virtualenv or Conda.

    If this option is selected, MindStudio will reuse this environment when creating a Python interpreter.

    Python version

    This parameter is available when Environment type is set to Conda.

    Select a Python version from the drop-down list.

    Conda executable

    This parameter is available when Environment type is set to Conda.

    It indicates the location of the Conda executable file. The system automatically checks the path of the Conda executable file. You can click the folder icon on the right to select the path.

    Pipenv executable

    This parameter is available when Environment type is set to Pipenv.

    It indicates the location of the Pipenv executable file. The system automatically checks the path of the Pipenv executable file. You can click the folder icon on the right to select the path.

    Poetry executable

    This parameter is available when Environment type is set to Poetry.

    It indicates the location of the Poetry executable file. The system automatically checks the path of the Poetry executable file. You can click the folder icon on the right to select the path.

  3. Click Create. A project is created.

    If there is already an active project in the window, a confirmation message is displayed.

    • Click This Window to open the newly created project in the current window.
    • Click New Window to open the newly created project in a new window.
  4. After the project is created, find the project directory displayed in a tree structure.

Importing a Python Project

  1. Import the project file.
    • On the MindStudio welcome page, click Open, select the project to be imported, and click OK.
    • On the MindStudio project page, choose File > Open... from the top menu bar or click on the menu bar to select an existing project and open it.

    If a project has code risks, the trust window is displayed when you open the project.

    • If the project source code is trusted and secure, click Trust Project. (You can select Trust projects in <workspace_directory> to trust all projects in the directory.)
    • If the project is not trusted and you only want to view the source code, click Preview in Safe Mode to preview the project in safe mode.
    • To cancel opening the project, click Don't Open.
  2. If there is already an active project in the window, a confirmation message is displayed.
    • Click This Window to open the project in the current window.
    • Click New Window to open the project in a new window.
  3. After the project is imported, find the project directory displayed in a tree structure.