Change PyCharm Source: Quick Guide

The steps to change the source in PyCharm are as follows:

  1. Open PyCharm and go to settings (either through the “File” menu and selecting “Settings” or using the shortcut Ctrl + Alt + S).
  2. In the settings window, expand the “Tools” option and select “Python External Tools”.
  3. In the “Python Interpreter” section on the right, choose the interpreter you want to change the source.
  4. Click on the “+” button to add a new external tool.
  5. Enter a descriptive name in the “Name” field (e.g. “Change Source”).
  6. In the “Interpreter” field, enter the path of the Python interpreter you want to use. You can find the path of the Python interpreter by running “which python” or “where python” in the command line.
  7. Enter the command to change the source in the “parameter” field. The command may vary depending on the package manager you are using. Here are some examples for common package managers:
  1. Change the pip source:
    config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
  2. Change the source in conda by running the command:
    config –set channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
  1. Click the “apply” button to save the changes.
  2. Close the settings window.

Now, you can use this new external tool in PyCharm to modify your source code. Just click on the “Tools” menu, select the tool you created, and your source will be changed to the one specified by you.

bannerAds