mirrorz-org/mirrorz-help

bug: 联合pip源出现无法寻找合适的pip包版本

Closed this issue · 10 comments

先决条件 (Prerequisites)

  • 我已确认这个问题没有在其他 issues中提出过。
    I am sure that this problem has NEVER been discussed in other issues.

发生了什么(What happened)

(aod) chen@Asus:~/py/aod$ pip install jupyter                                                                                                 
Looking in indexes: https://mirrors.cernet.edu.cn/pypi/web/simple                                                                             
ERROR: Could not find a version that satisfies the requirement jupyter (from versions: none)                                                  
ERROR: No matching distribution found for jupyter  

期望的现象(What you expected to happen)

()aod) chen@Asus:~/py/aod$ pip config set global.index-url https://mirrors.bfsu.edu.cn/pypi/web/simple                                         
Writing to /home/chen/.config/pip/pip.conf                                                                                                    
(aod) chen@Asus:~/py/aod$ pip install jupyter
Looking in indexes: https://mirrors.bfsu.edu.cn/pypi/web/simple                                                                               
Collecting jupyter                                                                                                                            
  Downloading https://mirrors.bfsu.edu.cn/pypi/web/packages/83/df/0f5dd132200728a86190397e1ea87cd76244e42d39ec5e88efd25b2abd7e/jupyter-1.0.0-py2.py3-none-any.whl (2.7 kB)

如何重现此问题(How to reproduce it)

(aod) chen@Asus:~/py/aod$ pip install jupyter                                                                                                 
Looking in indexes: https://mirrors.cernet.edu.cn/pypi/web/simple                                                                             
ERROR: Could not find a version that satisfies the requirement jupyter (from versions: none)                                                  
ERROR: No matching distribution found for jupyter  

操作系统(OS Version)

ubuntu24.04

浏览器(如果适用)(Browser version, if applicable)

No response

其他环境(Other environments)

conda

其他需要说明的事项(Anything else we need to know)

No response

请用下面的命令检查跳转的实际目标:

curl -v https://mirrors.cernet.edu.cn/pypi/web/simple
(base) chen@Asus:~$ conda activate test
(test) chen@Asus:~$ pip config set global.index-url https://mirrors.cernet.edu.cn/pypi/web/simple
Writing to /home/chen/.config/pip/pip.conf
(test) chen@Asus:~$ pip install jupyter
Looking in indexes: https://mirrors.cernet.edu.cn/pypi/web/simple
ERROR: Could not find a version that satisfies the requirement jupyter (from versions: none)
ERROR: No matching distribution found for jupyter
(test) chen@Asus:~$ curl -v https://mirrors.cernet.edu.cn/pypi/web/simple
* Host mirrors.cernet.edu.cn:443 was resolved.
* IPv6: 2001:250:4:100::2
* IPv4: 1.51.3.134
*   Trying 1.51.3.134:443...
* Connected to mirrors.cernet.edu.cn (1.51.3.134) port 443
* ALPN: curl offers h2,http/1.1
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
*  CAfile: /etc/ssl/certs/ca-certificates.crt
*  CApath: /etc/ssl/certs
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384 / X25519 / RSASSA-PSS
* ALPN: server accepted h2
* Server certificate:
*  subject: CN=mirrors.cernet.edu.cn
*  start date: Apr  7 07:29:28 2024 GMT
*  expire date: Jul  6 07:29:27 2024 GMT
*  subjectAltName: host "mirrors.cernet.edu.cn" matched cert's "mirrors.cernet.edu.cn"
*  issuer: C=US; O=Let's Encrypt; CN=R3
*  SSL certificate verify ok.
*   Certificate level 0: Public key type RSA (4096/152 Bits/secBits), signed using sha256WithRSAEncryption
*   Certificate level 1: Public key type RSA (2048/112 Bits/secBits), signed using sha256WithRSAEncryption
*   Certificate level 2: Public key type RSA (4096/152 Bits/secBits), signed using sha256WithRSAEncryption
* using HTTP/2
* [HTTP/2] [1] OPENED stream for https://mirrors.cernet.edu.cn/pypi/web/simple
* [HTTP/2] [1] [:method: GET]
* [HTTP/2] [1] [:scheme: https]
* [HTTP/2] [1] [:authority: mirrors.cernet.edu.cn]
* [HTTP/2] [1] [:path: /pypi/web/simple]
* [HTTP/2] [1] [user-agent: curl/8.5.0]
* [HTTP/2] [1] [accept: */*]
> GET /pypi/web/simple HTTP/2
> Host: mirrors.cernet.edu.cn
> User-Agent: curl/8.5.0
> Accept: */*
>
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* old SSL session ID is stale, removing
< HTTP/2 302
< server: nginx-n.wtf/1.25.4
< date: Mon, 13 May 2024 11:07:21 GMT
< content-type: text/html; charset=utf-8
< content-length: 67
< location: https://pypi.mirrors.cqupt.edu.cn/web/simple
< strict-transport-security: max-age=86400
<
<a href="https://pypi.mirrors.cqupt.edu.cn/web/simple">Found</a>.

* Connection #0 to host mirrors.cernet.edu.cn left intact

好像是重邮抽风了。我换到北外源就正常了。
这是目前的python版本

(test) chen@Asus:~$ python
Python 3.11.9 (main, Apr 19 2024, 16:48:06) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>

我们应该修好了

CQUPTMirror/Report#48

@sujoshua 似乎还是有问题的:

> docker run -it --rm python bash
root@1dd8b4b24750:/# pip config set global.index-url https://pypi.mirrors.cqupt.edu.cn/web/simple
Writing to /root/.config/pip/pip.conf
root@1dd8b4b24750:/# pip install jupyter
Looking in indexes: https://pypi.mirrors.cqupt.edu.cn/web/simple
ERROR: Could not find a version that satisfies the requirement jupyter (from versions: none)
ERROR: No matching distribution found for jupyter

@taoky try again?

没发现这个issue是关于pypi的,现在新的选项也设置到pypi了

@taoky try again?

没发现这个issue是关于pypi的,现在新的选项也设置到pypi了

https://pypi.mirrors.cqupt.edu.cn/web/simple 仍然是 404

重邮pypi到现在都没法正常访问.是否可以考虑暂时在只能选取界面暂时ban掉重邮pypi源

@machenme 联系 cqupt 负责同学后,https://mirrors.cqupt.edu.cn/api/mirrorz.json 中的 pypi 已经被移除,目前应该不会再重定向到这里了。

@machenme 联系 cqupt 负责同学后,https://mirrors.cqupt.edu.cn/api/mirrorz.json 中的 pypi 已经被移除,目前应该不会再重定向到这里了。

(ground) PS C:\> pip install -r .\requirements.txt
Looking in indexes: https://mirrors.cernet.edu.cn/pypi/web/simple
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x00000296034F7690>, 'Connection to mirror.lzu.edu.cn timed out. (connect timeout=15)')': /pypi/web/simple/anyio/
ERROR: Operation cancelled by user
(ground) PS C:\> pip config set global.index-url https://mirrors.bfsu.edu.cn/pypi/web/simple
Writing to C:\Users\chen\AppData\Roaming\pip\pip.ini
(ground) PS C:\> pip install -r .\requirements.txt
Looking in indexes: https://mirrors.bfsu.edu.cn/pypi/web/simple
Collecting anyio==4.3.0 (from -r .\requirements.txt (line 1))
  Downloading https://mirrors.bfsu.edu.cn/pypi/web/packages/14/fd/2f20c40b45e4fb4324834aea24bd4afdf1143390242c0b33774da0e2e34f/anyio-4.3.0-py3-none-any.whl (85 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 85.6/85.6 kB 1.6 MB/s eta 0:00:00
Collecting argon2-cffi==23.1.0 (from -r .\requirements.txt (line 2))
  Downloading https://mirrors.bfsu.edu.cn/pypi/web/packages/a4/6a/e8a041599e78b6b3752da48000b14c8d1e8a04ded09c88c714ba047f34f5/argon2_cffi-23.1.0-py3-none-any.whl (15 kB)

说实话,如果真的pip这个智能选择工作不是很好还是暂时别上了吧。

说实话,如果真的pip这个智能选择工作不是很好还是暂时别上了吧。

https://github.com/mirrorz-org/mirrorz-302/blob/3ecabd19c6142e930164a44c6bb9d0318d9ff284/pkg/influxdb/influxdb.go#L57

influxdb 的数据每 3min 更新一次,目前的预期行为是,如果镜像站点在 15min 内没有数据,那么 302 后端就不会提供对应的镜像站点。(如果在 15min 之后还提供有问题的镜像站,那么这是 bug)

对于预期的维护,镜像站点需要设置 disable field 为 true;非预期的掉线情况则在 15min 之后不会被采用。