Pythonhosted.org mistakenly blocked by Roskomnadzor
The reason for writing the article was the lack of mention of this event in Runet. The reason for this, presumably, is the providers' non-compliance with the ILV requirements, which will be discussed below. I managed to find it only on the corporate network. But there is no doubt that sooner or later it will affect everyone.
Analysis and details under the cut.
Reasons for blocking
On April 4, the Moscow City Court ruled in case No. 3-0154 / 2019 on the permanent blocking of streamable.com resources . However, for reliability, the ILV also blocked its IP addresses, which coincidentally coincide with the addresses of pythonhosted.org.
As a result , the following entries related to the court decision appeared in the register of locks of Roskomnadzor :
You can verify their availability yourself.
As I mentioned above, the IP addresses of pythonhosted.org and the locked resource are the same, which is easy to confirm:
> dig pythonhosted.org ; <<>> DiG 9.11.5-P1-1ubuntu2.4-Ubuntu <<>> pythonhosted.org ;; global options: +cmd ;; Got answer: ... ;; ANSWER SECTION: pythonhosted.org. 10 IN A 220.127.116.11 pythonhosted.org. 10 IN A 18.104.22.168 pythonhosted.org. 10 IN A 22.214.171.124 pythonhosted.org. 10 IN A 126.96.36.199 ;; Query time: ... > dig streamable.com ; <<>> DiG 9.11.5-P1-1ubuntu2.4-Ubuntu <<>> streamable.com ;; global options: +cmd ;; Got answer: ... ;; ANSWER SECTION: streamable.com. 60 IN A 188.8.131.52 streamable.com. 60 IN A 184.108.40.206 streamable.com. 60 IN A 220.127.116.11 streamable.com. 60 IN A 18.104.22.168 ;; Query time: ...
This article has no purpose to analyze the details of pip, you just need to know that the package index is stored on the pypi.org domain, the files themselves are on files.pythonhosted.org. As a result, working with a standard package manager becomes difficult or not possible at all.
For those who have already been touched
Here is a short list of the most popular options for using pip. It does not pretend to be encyclopedic; for fine details, it is better to refer to the official documentation .
- Global VPN or proxy
- Individual proxy for pip
is possible to set environment variables
HTTP_PROXYwhose explicit argument
pip --proxy $proxy ...or configuration file . All options support the format
- Using an alternative packet index
A key option is
index-urlthat, like proxies, you can pass in the ways described above.
- Raising a corporate / home mirror pypi.org
The noblest and most complex, and disk space requires as much as 6 TB ( here is a dashboard with information on resources, including the PyPI Mirror Size graph ).
- Use IPv6
There are DNS records for pythonhosted.org with IPv6 addresses that have not been blocked. But not every provider or network supports this protocol.
The news is unlikely to surprise, because such situations occur, and occur regularly. I do not call for scribbling complaints about Roskomnadzor or suing for broken pipelines. But get ready in advance.