PyCharm 2022.2 Help

Configure an interpreter using command line

When launching PyCharm from the command line, you can specify which Python interpreter to use for new and existing projects.

Launch PyCharm with a pre-configured Python interpreter

You can find the executable for running PyCharm in the installation directory under bin. To use this executable as the command-line launcher, add it to your system PATH as described in Command-line interface.

  1. In the command line, execute the following command to set the PYCHARM_PYTHON_PATH variable:

    set PYCHARM_PYTHON_PATH=<PATH_TO_PYTHON>

    Replace <PATH_TO_PYTHON> with a path to the required Python SDK executable.

  2. Launch PyCharm from the same shell:

    <PYCHARM_INSTALLATION_PATH>\bin\pycharm64.exe

    <PYCHARM_INSTALLATION_PATH> is the path to the PyCharm installation directory. For example, C:\Program Files\JetBrains\PyCharm.

    If you have added the PyCharm executable to PATH, just type pycharm.

By default, PyCharm does not provide a command-line launcher. For information about creating a launcher script for PyCharm, see Command-line interface.

  1. In the command line, execute the following command to set the PYCHARM_PYTHON_PATH variable:

    PYCHARM_PYTHON_PATH=<PATH_TO_PYTHON>

    Replace <PATH_TO_PYTHON> with a path to the required Python SDK executable.

  2. Launch PyCharm from the same shell:

    open -na "PyCharm.app"

    If you have created a launcher script, just type pycharm.

You can find the script for running PyCharm in the installation directory under bin. To use this script as the command-line launcher, create a symbolic link in a directory from the PATH environment variable as described in Command-line interface.

  1. In the command line, execute the following command to set the PYCHARM_PYTHON_PATH variable:

    export PYCHARM_PYTHON_PATH=<PATH_TO_PYTHON>

    Replace <PATH_TO_PYTHON> with a path to the required Python SDK executable.

  2. Launch PyCharm from the same shell:

    sh <PYCHARM_INSTALLATION_PATH>/bin/pycharm.sh

    <PYCHARM_INSTALLATION_PATH> is the path to the PyCharm installation directory. For example, /opt/pycharm/.

    If you have created a symbolic link to the launcher script, just type pycharm.

Last modified: 04 August 2022