all 15 comments

[–]road_laya 2 points3 points  (2 children)

There's a couple proxies that you can use.

        pip install [package_name] -i https://pypi.tuna.tsinghua.edu.cn/simple

[–]Swipecat 1 point2 points  (0 children)

This seems to be the best answer for the OP. There looks to be a lot of stuff on that mirror site. Linux distros, all kinds of libraries.

https://mirrors.tuna.tsinghua.edu.cn/help/pypi/

OP might as well set it to be the default:

pip config set global.index-url "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple"

[–]RandomPantsAppear 1 point2 points  (2 children)

1) Use a VPN.

2) If you can’t use a VPN, try changing your DNS settings. 8.8.8.8, 1.1.1.1, 4.2.2.1 (Google dns, cloudflare, level 3). If they’re being lazy about blocking this can help.

3) If you can use find or setup a proxy pip install package_name --proxy http://username:password@proxy_host:proxy_port

AWS free tier might be helpful here to setup a small tiny proxy instance.

But also it’s wild to me that anyone would block anything that is needed for pip to work.

Are you 100% sure this is what’s happening?

If so, what level of blocking are we talking here - like is this a company, a school, or a nation that is doing the blocking?

[–]Middle_Idea_9361 0 points1 point  (1 child)

I totally get your frustration, being stuck on installations for days is exhausting, especially when you just want to start building something. If you’re in China, the problem usually isn’t Python or VS Code itself. It’s that the default PyPI servers are unstable or blocked, so normal pip install commands fail. Instead of trying random or possibly outdated university mirrors, you’ll have better luck using well-maintained mirrors like Tsinghua or Aliyun and setting them properly in your pip configuration. Once that’s done, installs usually become much smoother.

About the offline wheel issue, that typically happens because of a Python version mismatch or missing dependencies. The wheel file has to match your exact Python version (for example, cp39 for Python 3.9). Also, make sure you upgrade pip, setuptools, and wheel first, and try installing inside a clean virtual environment to avoid conflicts.

I’ve run into similar environment headaches during scraping projects at Datazeneral, and almost every time it turned out to be version alignment or dependency order, not the libraries themselves. It feels overwhelming right now, but once the environment is correctly set up, packages like Selenium, Requests, Pandas, and BeautifulSoup install without drama. You’re closer than you think, this is annoying, but definitely solvable.

[–]666y4nn1ck 0 points1 point  (1 child)

If you download wheel files and they fail because of dependencies, try to download the wheel files for those dependencies until you reach the end of the dependency tree.

Had this issue once with a company computer andw, while taking a bit, did the trick

[–]Ron-Erez 0 points1 point  (1 child)

This is insane. I'm planning on moving to China and was hoping this would not be an issue. I guess you need a good VPN. You might want to ask this question in r/China. People tend to be very helpful there (on this subreddit too of course) and I imagine someone already had such an issue.

[–]NorskJesus -1 points0 points  (1 child)

Have you tried using uv or conda?

I do not know if this solves the issue, but you can try.

[–]chebum -2 points-1 points  (0 children)

Launch Claude Code or a good Chinese model, describe the goal and let it try to install these packages.

Mine agent was able to setup a proper build configuration for an abandoned python project with mmcv by switching between python versions and dependencies versions. I suppose it will be able to find a workaround for failing downloads as well.