Pycharm replacement source (source change) (mirror source)


Reference article: Pycharm software replaces pip’s default installation source with domestic installation source

I tried it, and it didn’t seem to work if I changed it.

I’d better use that one

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple xxx

Article directory

  • 20230816
  • Detailed explanation of PyCharm source change (mirror source)
    • Table of contents
    • What is PyCharm?
    • Why change the source of PyCharm?
    • How to change the source of PyCharm?
      • Change source in PyCharm settings
      • Replace source through pip configuration file
    • Frequently asked questions and solutions
    • Summarize

20230816

Detailed explanation of PyCharm source change (mirror source)

This article aims to provide readers with detailed steps and instructions on how to change sources or mirror sources in PyCharm. This is especially useful for users who want to speed up package downloads or who are unable to access the default source due to network issues.

Directory

  1. What is PyCharm?
  2. Why change the source of PyCharm?
  3. How to change the source of PyCharm?
    • Change source in PyCharm settings
    • Replace source through pip configuration file
  4. Frequently asked questions and solutions
  5. Summarize

What is PyCharm?

PyCharm is a Python IDE developed by JetBrains with coding assistance, debugging, unit testing and other functions. It also supports web development technologies such as Django, ask, etc.

print("Hello, PyCharm!")

Why change the source of PyCharm?

Python package management tools (such as pip) usually obtain packages from PyPI (Python Package Index). However, access to PyPI may be difficult in some regions due to network reasons. In addition, since the PyPI server is abroad, the download speed may be slow. In this case, changing to a mirror source can solve these problems.

Reference article: “How to Speed Up Python Package Installation”

How to change the source of PyCharm?

The following two methods are available:

Change source in PyCharm settings

  1. Open PyCharm and click File -> Settings in the top navigation bar.
  2. In the pop-up window, select Project -> Python Interpreter.
  3. Click the + buttons on the right to add a new package.
  4. In the pop-up window, click Manage Repositories in the lower right corner.
  5. Here, you can add new sources (such as Alibaba Cloud, Douban, etc.) and then delete the default PyPI source.
For example, you can add the following mirror sources:
- Alibaba Cloud: https://mirrors.aliyun.com/pypi/simple/
- Douban: http://pypi.douban.com/simple/

Change the source through pip configuration file

Another method is to modify pip’s configuration file directly. The pip configuration file is usually located in the user’s home directory and is named pip.ini or pip.conf.

  1. Open the configuration file and create one if it does not exist.
  2. Add the following:
[global]
index-url = https://mirrors.aliyun.com/pypi/simple/
  1. Save and close the file. Now, pip will install the package using the new source.

Frequently asked questions and solutions

Problem: After changing the source, the package still cannot be installed or the speed is not improved.

Solution: Make sure the source address is added correctly and that the source is accessible. If the problem persists, you can try clearing the pip cache or restarting PyCharm.

Reference article: “Troubleshooting PyCharm”

Summary

This article explains how to change sources in PyCharm to speed up package downloads or troubleshoot network issues. Users can do this via PyCharm settings or directly modify the pip configuration file.

Although this article only describes how to change to Alibaba Cloud sources, users can also change to other sources according to their own needs. It is worth noting that reliable and stable sources should always be chosen to ensure package quality and download speed.

Finally, if you encounter any problems, you can check the corresponding reference articles or seek help from the community.

import this

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
? ?

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
? ?

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
? ?