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.
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.
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.note
This command sets the
PYCHARM_PYTHON_PATH
environment variable only for the current shell.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 typepycharm
.
tip
You can open an existing project by providing the path to the project folder when you launch PyCharm. For more information, refer to Open files from the command line.
By default, PyCharm does not provide a command-line launcher. For more information about creating a launcher script for PyCharm, refer to Command-line interface.
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.note
This command sets the
PYCHARM_PYTHON_PATH
environment variable only for the current shell.Launch PyCharm from the same shell:
$open -na "PyCharm.app"
note
If PyCharm is not in the default /Applications directory, specify the full path to it.
If you have created a launcher script, just type
pycharm
.
tip
You can open an existing project by providing the path to the project folder when you launch PyCharm. For more information, refer to Open files from the command line.
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.
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.note
This command sets the
PYCHARM_PYTHON_PATH
environment variable only for the current shell.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
.
tip
You can open an existing project by providing the path to the project folder when you launch PyCharm. For more information, refer to Open files from the command line.
Thanks for your feedback!