how to install python modules where pipy.org is is not accessible from iran?
Asked Answered
D

6

6

so the problem is that pypi.org hase been filtered by iranian government(yes , i know it's ridiculous!). i tried to install some python modules from Github downloaded files: pip install moduleName but every module has it's own dependencies and try to connect to pipy.org to reach them. then there will be an error during installation. is there any solution? your help will be much appreciated.

Doerrer answered 23/1, 2023 at 15:49 Comment(1)
There are some PyPI mirrors, maybe one is trustworthy enough from your proint of view and is not blocked. I would not know where to find them though. I think I have seen this one mentioned before, but I can not vouch for it: developer.aliyun.com/mirror/pypiDrillmaster
B
0

I live in a country that also blocks services, mostly streaming platforms. In theory, the way behind this is the same whether to watch Netflix or download python and its dependencies. That is you'll probably need to use a VPN.

As said by d-dutchveiws, there's tons of videos and resources on how to set up a VPN. If you do end up using a paid VPN service I would just like to add that I lived in the UAE for a while and I found that some VPN services were blocked by the country themselves. I know NordVPN did not work/was blocked by the UAE so I ended up finding expressVPN and that worked. In other words, I'd be sure not to commit to any payment plan/only use free trials because even the VPN services can be blocked. Hope I helped a bit!

Bodoni answered 23/1, 2023 at 16:16 Comment(1)
thanks for your help. it seems that we have same problems. As the saying goes, Two things are infinite: the universe and human stupidity.Doerrer
U
2

One of the ways to solve this problem is using some mirrors of pypi that can access in Iran. This can lead to faster download/install speeds. One of mirrors you can use is iranrepo.ir. A sample of installing a package using iranrepo mirror is like this:

pip install MODULE_NAME --index-url=https://pypi.iranrepo.ir/simple
Unmeant answered 11/9, 2023 at 7:2 Comment(0)
R
2

While dealing with a domestic cloud provider in Iran, I came across an issue that was resolved by using the mirror server of Southern University of Science and Technology.

pip install MODULE_NAME --index-url=https://mirrors.sustech.edu.cn/pypi/web/simple/
Reeding answered 1/1, 2024 at 16:34 Comment(0)
B
0

Try and use a VPN this will bypass any block on certain sites. Just google VPN for the top results.

Barquisimeto answered 23/1, 2023 at 15:59 Comment(0)
B
0

I live in a country that also blocks services, mostly streaming platforms. In theory, the way behind this is the same whether to watch Netflix or download python and its dependencies. That is you'll probably need to use a VPN.

As said by d-dutchveiws, there's tons of videos and resources on how to set up a VPN. If you do end up using a paid VPN service I would just like to add that I lived in the UAE for a while and I found that some VPN services were blocked by the country themselves. I know NordVPN did not work/was blocked by the UAE so I ended up finding expressVPN and that worked. In other words, I'd be sure not to commit to any payment plan/only use free trials because even the VPN services can be blocked. Hope I helped a bit!

Bodoni answered 23/1, 2023 at 16:16 Comment(1)
thanks for your help. it seems that we have same problems. As the saying goes, Two things are infinite: the universe and human stupidity.Doerrer
U
0

This issue has been there for a while now, the easiest fix to this is to use proxies with pip!

pip has a --proxy option which can be used to set a proxy, all you need is a VPS located outside of the country with free internet access, then you can create a ssh tunnel between your local machine to the VPS, setting a local port would make it work as a proxy on your local machine so you can use it as a proxy!

A real world example would be like this.

Ulysses answered 11/9, 2023 at 7:51 Comment(0)
S
0

My problem was solved with this repository:

pip install PACKAGE_NAME -i https://mirrors.aliyun.com/pypi/simple/
Sextet answered 23/9, 2024 at 9:38 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.