Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add selection of Pypi mirrors in the GUI #173

Open
3 tasks
jfthuong opened this issue Oct 7, 2023 · 2 comments
Open
3 tasks

Add selection of Pypi mirrors in the GUI #173

jfthuong opened this issue Oct 7, 2023 · 2 comments
Labels
enhancement New features or code improvements

Comments

@jfthuong
Copy link

jfthuong commented Oct 7, 2023

📝 Description of the feature

In some countries (e.g. China), access to Pypi is a bit slow, especially when downloading huge modules like Tensorflow and other ML modules.

An efficient solution is to setup a mirror site for Pypi. For example in China you can use https://pypi.tuna.tsinghua.edu.cn.

It would be nice to have a way to set-up a mirror, and even nicer to have a pre-polulated list.

Also, some users might use a private Pypi server in their company, which uses the same concept

💡 Steps for implementing the feature

  • Find a list of the best pypi mirror servers
  • Update the UI to be able to select one and add your own
  • Update the backend to launch pip with this server

🔗 Useful links and references

To use pip with a mirror:
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple some-package

To set as default:
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

Documentation of 2 mirrors (both in China):

@jfthuong jfthuong added the enhancement New features or code improvements label Oct 7, 2023
@hh-wu
Copy link

hh-wu commented Oct 10, 2023

I have test the url format of the mirror in PRC.

PYTHON_URLS = {
    'PRC': {
        'python_mirror': 'https://registry.npmmirror.com/-/binary/python/{selected_version}/python-{selected_version}-amd64.exe',
        'pypi_mirror': "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/json/{pkg_name}"
    },
    'Defaults': {
        'python_mirror': "https://www.python.org/ftp/python/{selected_version}/python-{selected_version}-amd64.exe",
        'pypi_mirror': "https://pypi.python.org/pypi/{pkg_name}/json",
    }
}

@RobPasMue
Copy link
Member

Hi @hh-wu @jfthuong - this might be a great addition. Currently my support to this project is limited but I will try to do my best to implement it over the next couple of weeks. I do find value in your proposed issue - I understand that some countries might have restrictions and issues with the main server bandwidth. Feel free to open a PR in the meantime to implement this. Otherwise I will try to support it in a couple of weeks. =)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New features or code improvements
Projects
None yet
Development

No branches or pull requests

3 participants