全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

IP归属甄别会员请立即修改密码
查看: 474|回复: 4
打印 上一主题 下一主题

[疑问] python3 nchnroutes 跑着出错 请问哪里的问题??

[复制链接]
跳转到指定楼层
1#
发表于 2022-3-15 17:20:23 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

https://github.com/dndx/nchnroutes

[root@localhost nchnroutes-main]# make
git pull
fatal: Not a git repository (or any of the parent directories): .git
make: *** [produce] Error 128
[root@localhost nchnroutes-main]#

[root@localhost nchnroutes-main]# python3 produce.py
Traceback (most recent call last):
  File "produce.py", line 109, in <module>
    subtract_cidr(root, (a,))
  File "produce.py", line 81, in subtract_cidr
    if n.cidr.supernet_of(cidr_to_sub):
AttributeError: 'IPv4Network' object has no attribute 'supernet_of'
[root@localhost nchnroutes-main]#

想获取非国内V4 V6地址
2#
发表于 2022-3-15 17:22:12 | 只看该作者
应该是库的版本不对吧
3#
 楼主| 发表于 2022-3-15 17:39:51 | 只看该作者
keygen8 发表于 2022-3-15 17:22
应该是库的版本不对吧

刚才又新建了个VPS试了一次,也是错误的。
作者代码有问题

Installed:
  python3.x86_64 0:3.6.8-18.el7                                                                     

Dependency Installed:
  python3-libs.x86_64 0:3.6.8-18.el7                    python3-pip.noarch 0:9.0.3-8.el7            
  python3-setuptools.noarch 0:39.2.0-10.el7            

Complete!
[root@kcp nchnroutes]# make
git pull
Already up-to-date.
curl -o delegated-apnic-latest https://ftp.apnic.net/stats/apnic/delegated-apnic-latest
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 3478k  100 3478k    0     0   747k      0  0:00:04  0:00:04 --:--:--  824k
curl -o china_ip_list.txt https://raw.githubusercontent.com/17mon/china_ip_list/master/china_ip_list.txt
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 95267  100 95267    0     0   759k      0 --:--:-- --:--:-- --:--:--  762k
python3 produce.py
Traceback (most recent call last):
  File "produce.py", line 109, in <module>
    subtract_cidr(root, (a,))
  File "produce.py", line 81, in subtract_cidr
    if n.cidr.supernet_of(cidr_to_sub):
AttributeError: 'IPv4Network' object has no attribute 'supernet_of'
make: *** [produce] Error 1
[root@kcp nchnroutes]#
4#
发表于 2022-3-15 17:46:48 | 只看该作者
KDE 发表于 2022-3-15 17:39
刚才又新建了个VPS试了一次,也是错误的。
作者代码有问题

应该是你的python3版本太低,换个高点的试试

点评

KDE
谢谢大佬 安装最新的python3.10.2成功运行  发表于 2022-3-15 18:58
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2025-9-18 01:54 , Processed in 0.059906 second(s), 13 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表