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.
所以问题是pypi.org已经被伊朗政府过滤掉了(是的,我知道这很荒谬!)。我试图从Github下载的文件中安装一些python模块:pip-install-moduleName,但每个模块都有自己的依赖项,并尝试连接到pipy.org来访问它们。那么在安装过程中将出现错误。有什么解决办法吗?我们将非常感谢你的帮助。
更多回答
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/pypi
有一些PyPI镜像,也许从你的角度来看,其中一个足够值得信赖,并且没有被阻止。我不知道在哪里可以找到它们。我想我以前见过这个,但我不能保证:developer.aliyun.com/mirror/pypi
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:
解决这个问题的方法之一是使用一些可以在伊朗访问的pypi镜像。这可以提高下载/安装速度。您可以使用的镜像之一是iranrepo.ir。使用iranrepo镜像安装软件包的示例如下:
pip install MODULE_NAME --index-url=https://pypi.iranrepo.ir/simple
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.
我生活在一个同样屏蔽服务的国家,主要是流媒体平台。理论上,无论是观看Netflix还是下载python及其依赖项,这背后的方式都是一样的。也就是说,你可能需要使用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!
正如d-dutchvews所说,有大量关于如何设置VPN的视频和资源。如果你最终使用了付费VPN服务,我只想补充一点,我在阿联酋住了一段时间,我发现一些VPN服务被国家自己屏蔽了。我知道NordVPN不起作用/被阿联酋屏蔽了,所以我最终找到了expressVPN,这起了作用。换句话说,我肯定不会承诺任何支付计划/只使用免费试用,因为即使是VPN服务也可能被屏蔽。希望我能帮上一点忙!
Try and use a VPN this will bypass any block on certain sites. Just google VPN for the top results.
尝试使用VPN,这将绕过某些网站上的任何阻止。只需谷歌VPN即可获得最佳结果。
This issue has been there for a while now, the easiest fix to this is to use proxies with pip!
这个问题已经存在了一段时间了,最简单的解决方法是使用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!
pip有一个--proxy选项,可以用来设置代理,你只需要一个位于国外的VPS,可以免费访问互联网,然后你可以在本地机器和VPS之间创建一个ssh隧道,设置一个本地端口可以让它在本地机器上充当代理,这样你就可以把它用作代理了!
A real world example would be like this.
一个真实世界的例子就是这样。
更多回答
thanks for your help. it seems that we have same problems. As the saying goes, Two things are infinite: the universe and human stupidity.
谢谢你的帮助。看来我们也有同样的问题。俗话说,有两样东西是无限的:宇宙和人类的愚蠢。
我是一名优秀的程序员,十分优秀!