MT7688固件编译故障修复:XML-Parser组件缺失(perl-XML-parser)(XML::parser)

在编译MT7688固件时遇到XML-Parser组件缺失的错误,通过`apt-get`安装`libxml-simple-perl`,然后使用CPAN安装`XML::Parser`,过程中遇到权限和依赖问题,通过手动创建Makefile、添加权限最终成功安装。
摘要由CSDN通过智能技术生成

前言

正在编译编译mt7688的固件,正开心这呢,然而突然报错,我瞬间爆炸,然后刷的冷静下来,问题不大我能解决。首先查看打印信息明确故障原因是缺少组件XML-Parser,于是查阅资料补上这个缺口继续编译。

起始bug打印

checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for perl... /home/b/Desktop/mt7688/openwrt_widora/staging_dir/host/bin/perl
checking for perl >= 5.8.1... 5.18.2
checking for XML::Parser... configure: error: XML::Parser perl module is required for intltool
make[3]: *** [/home/b/Desktop/mt7688/openwrt_widora/build_dir/host/intltool-0.40.6/.configured] Error 1
make[3]: Leaving directory `/home/b/Desktop/mt7688/openwrt_widora/feeds/packages/libs/intltool'
make[2]: *** [package/feeds/packages/intltool/host/compile] Error 2
make[2]: Leaving directory `/home/b/Desktop/mt7688/openwrt_widora'
make[1]: *** [/home/b/Desktop/mt7688/openwrt_widora/staging_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/stamp/.package_compile] Error 2

设计解决思路

根据打印网上搜索得知是缺少了XML-Parser组件,因此进行补充。
部分资料显示,需要下载安装源码包:
XML-Parser-2.34.tar.gz
然而对于这个源码包的相关搜索通常指向了付费链接,这不能忍
因此我选择尝试其他思路:
https://www.douban.com/note/493624754/
这篇文章遇到了类似的问题,因此我参照了一下解决步骤。

依次执行

sudo apt-get install libxml-simple-perl

sudo apt-get install libxml-simple-perl
进行第一阶段安装
(打印见下方打印1,操作就是需要y的地方y回车其余回车)

perl -e shell –MCPAN

perl -e shell –MCPAN
进行第二阶段安装2
(非常多的打印,操作就是一路回车)
然后输入

install XML::Parser

cpan[1]>install XML::Parser
进行第三阶段安装
(详细见打印二)
然而出了点问题:
Failed during this command:
TODDR/XML-Parser-2.46.tar.gz : writemakefile NO – No ‘Makefile’ created
我寻思应该是要手动安装
输入quit离开cpan

perl Makefile.PL

进入下载的目录输入指令
b@ubuntu:~/.cpan/build/XML-Parser-2.46-Wc9hvw$ perl Makefile.PL
出现故障,我认为是缺少Expat
因此输入指令:
b@ubuntu:~/.cpan/build/XML-Parser-2.46-Wc9hvw$ sudo apt-get install expat
b@ubuntu:~/.cpan/build/XML-Parser-2.46-Wc9hvw$ sudo apt-get install libexpat1-dev
重新执行perl Makefile.PL,通过了
(详细见打印三)

make

(打印太多跳过)

make test

(见相关打印四)

make install

(见相关打印五)
故障了,我认为是缺少权限
使用sudo make install
通过
通过了(部分见打印六)
完结撒花

Signing package index...
make[2]: Leaving directory `/home/b/Desktop/mt7688/openwrt_widora'
make[1]: Leaving directory `/home/b/Desktop/mt7688/openwrt_widora'
b@ubuntu:~/Desktop/mt7688/openwrt_widora$ 

相关打印

打印1

b@ubuntu:~/Desktop/mt7688/openwrt_widora$ sudo apt-get install libxml-simple-perl 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  libencode-locale-perl libfile-listing-perl libfont-afm-perl
  libhtml-form-perl libhtml-format-perl libhtml-parser-perl
  libhtml-tagset-perl libhtml-tree-perl libhttp-cookies-perl
  libhttp-daemon-perl libhttp-date-perl libhttp-message-perl
  libhttp-negotiate-perl libio-html-perl liblwp-mediatypes-perl
  liblwp-protocol-https-perl libnet-http-perl libwww-perl
  libwww-robotrules-perl libxml-namespacesupport-perl libxml-parser-perl
  libxml-sax-base-perl libxml-sax-expat-perl libxml-sax-perl
Suggested packages:
  libdata-dump-perl libcrypt-ssleay-perl libauthen-ntlm-perl
The following NEW packages will be installed:
  libencode-locale-perl libfile-listing-perl libfont-afm-perl
  libhtml-form-perl libhtml-format-perl libhtml-parser-perl
  libhtml-tagset-perl libhtml-tree-perl libhttp-cookies-perl
  libhttp-daemon-perl libhttp-date-perl libhttp-message-perl
  libhttp-negotiate-perl libio-html-perl liblwp-mediatypes-perl
  liblwp-protocol-https-perl libnet-http-perl libwww-perl
  libwww-robotrules-perl libxml-namespacesupport-perl libxml-parser-perl
  libxml-sax-base-perl libxml-sax-expat-perl libxml-sax-perl
  libxml-simple-perl
0 upgraded, 25 newly installed, 0 to remove and 10 not upgraded.
Need to get 1,277 kB of archives.
After this operation, 3,991 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://mirrors.cn99.com/ubuntu/ trusty/main libencode-locale-perl all 1.03-1 [12.4 kB]
Get:2 http://mirrors.cn99.com/ubuntu/ trusty/main libhttp-date-perl all 6.02-1 [10.4 kB]
Get:3 http://mirrors.cn99.com/ubuntu/ trusty/main libfile-listing-perl all 6.04-1 [9,774 B]
Get:4 http://mirrors.cn99.com/ubuntu/ trusty/main libfont-afm-perl all 1.20-1 [14.3 kB]
Get:5 http://mirrors.cn99.com/ubuntu/ trusty/main libhtml-tagset-perl all 3.20-2 [13.5 kB]
Get:6 http://mirrors.cn99.com/ubuntu/ trusty/main libhtml-parser-perl amd64 3.71-1build1 [98.2 kB]
Get:7 http://mirrors.cn99.com/ubuntu/ trusty/main libio-html-perl all 1.00-1 [15.7 kB]
Get:8 http://mirrors.cn99<
  • 3
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
这个错误通常是由于 Pandas 中的 `read_csv()` 函数在读取文件时,无法识别时间字符串的格式导致的。你需要指定正确的时间格式,让 Pandas 能够正确地将时间字符串转换为时间格式。可以尝试使用以下方法解决这个问题: 首先检查一下你的 CSV 文件是否包含正确的时间格式。如果时间格式不正确,可以尝试使用 Excel 或文本编辑器等工具进行修改。 如果时间格式正确,那么你需要在 `read_csv()` 函数中添加一个 `parse_dates` 参数来指定时间列的格式。例如,如果你的时间列名为 `date`,时间格式为 `%Y-%m-%d %H:%M:%S`,可以像下面这样指定: ```python import pandas as pd df = pd.read_csv('your_file.csv', parse_dates=['date'], date_parser=lambda x: pd.to_datetime(x, format='%Y-%m-%d %H:%M:%S', errors='coerce')) ``` 这里使用了 `parse_dates` 参数来指定时间列名为 `date`,并通过 `date_parser` 参数指定了时间格式为 `%Y-%m-%d %H:%M:%S`。`errors='coerce'` 表示将无法转换的值设置为 NaT(Not a Time)。 如果你的 CSV 文件中有多个时间列,可以将时间列名放在一个列表中传递给 `parse_dates` 参数。例如: ```python df = pd.read_csv('your_file.csv', parse_dates=['date', 'date_received'], date_parser=lambda x: pd.to_datetime(x, format='%Y-%m-%d %H:%M:%S', errors='coerce')) ``` 这里将 `date` 和 `date_received` 列都指定为时间列,并使用相同的时间格式进行转换。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值