黄老之道分享 http://blog.sciencenet.cn/u/jawa 德光上贤,志照正宗!

博文

cpan安装Perl模块的Indexing failed!问题

已有 24389 次阅读 2016-2-29 14:57 |个人分类:人才培养|系统分类:教学心得

【黄子按曰:】前些年Google被墙后,用了一段时间的EverNote,先是国际版,后是中国版。今天偶然重新进入国际版账户,发现还有一些旧笔记,《Perl生物信息学编程》课程还能用得上,现在以博文形式分享在这里。【:黄子按曰】

使用“草莓萢儿”的cpan安装新模块,shell一直反馈:
Indexing failed! at D:/Strawberry/perl/vendor/lib/CPAN/SQLite.pm line 70, line 8.
......

Google一下,stackoverflow上一位遭遇与我类似。网友众说纷纭。其中,brian d foy的说法如下:
You don't need to reinstall Strawberry anytime you have a problem. I know this is Windows, but life is better than that. Try deleting C:strawberrycpansourcesmodules2packages.details.txt.gz, which appears to be corrupted. CPAN.pm should re-download it if it is missing.
answered Feb 21 at 16:04 brian d foy

可惜这一回答未得到发帖者认可,发帖者始终认为是网络及权限问题。
I did that as well. This is a fresh install to begin with, so I did try a full reinstall as well as deleting the corrupted file. The issue is with the network connection, at least without SQLite. The network firewall is burning the request as an unauthorized user, even with admin rights. – steventnorris


但是,我知道brian d foy乃萢儿大牛,所言必有其道理,不可轻信发帖者的意见。于是按图索骥,发现我的目录中02packages.details.txt.gz只有1k大小,于是删去。再次进入cpan的shell, 然后install所需模块,shell反馈:
Fetching with LWP:
http://cpan.strawberryperl.com/modules/02packages.details.txt.gz
Creating database file ...
Indexing failed! at D:/Strawberry/perl/vendor/lib/CPAN/SQLite.pm line 70, line 8.
......

咦,难道发帖者是对的?仔细一看,02packages.details.txt.gz已经变成1388K大小了,但modules目录下还有一个03modlist.data.gz也还只有1K,于是删除该文件后再次进入cpan的shell并install所需模块,shell反馈:
Fetching with LWP:
http://cpan.strawberryperl.com/modules/03modlist.data.gz
Creating database file ...
Indexing failed! at D:/Strawberry/perl/vendor/lib/CPAN/SQLite.pm line 70, line 8.
CPAN::SQLite setup failed at D:/Strawberry/perl/vendor/lib/CPAN/SQLite/META.pm line 339, <DATA> line 8.
......

再看,03modlist.data.gz已211K大小了,但奇了怪了,问题仍未解决。举一反三,在sources文件夹下,除了modules文件夹外,还有一个authors文件夹,内有01mailrc.txt.gz文件,也只有1k,删除该文件后再次进入cpan的shell并install所需模块,shell反馈:
Fetching with LWP:
http://cpan.strawberryperl.com/authors/01mailrc.txt.gz
Creating database file ...
Done!Running install for module ......
成功下载所需模块,自动解决模块依赖性问题,测试、安装,一切OK。大牛所言虽然不全,但本菜鸟受益匪浅。



https://blog.sciencenet.cn/blog-204973-959471.html

上一篇:《Perl 生物信息学编程》致谢
下一篇:cpan安装模块的Indexing failed!问题(续)
收藏 IP: 210.41.106.*| 热度|

1 张珑

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...
扫一扫,分享此博文

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-11-22 00:37

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部