无法安装 Net::Amazon::S3

Posted

技术标签:

【中文标题】无法安装 Net::Amazon::S3【英文标题】:Can't Install Net::Amazon::S3 【发布时间】:2020-11-18 10:32:29 【问题描述】:

我在运行 32 位 Strawberry Perl 的 Win 10 机器上安装用于 perl 的 Net::Amazon::S3 软件包时遇到问题。

我尝试用cpanm安装包:

λ cpanm Net::Amazon::S3
--> Working on Net::Amazon::S3
Fetching http://www.cpan.org/authors/id/L/LL/LLAP/Net-Amazon-S3-0.89.tar.gz ... OK
Configuring Net-Amazon-S3-0.89 ... OK
Building and testing Net-Amazon-S3-0.89 ... FAIL
! Installing Net::Amazon::S3 failed. See C:\Users\MyUsername\.cpanm\work\1595972364.5912\build.log for details. Retry with --force to force install it.

build.log的内容:

cpanm (App::cpanminus) 1.7044 on perl 5.030002 built for MSWin32-x86-multi-thread-64int
Work directory is C:\Users\MyUsername/.cpanm/work/1595972364.5912
You have make C:\Strawberry\c\bin\gmake.exe
You have LWP 6.43
You have G:\laragon\bin\git\usr\bin\tar.exe, G:\laragon\bin\git\usr\bin\gzip.exe and G:\laragon\bin\git\usr\bin\bzip2.exe
You have G:\laragon\bin\git\usr\bin\unzip.exe
Searching Net::Amazon::S3 () on cpanmetadb ...
--> Working on Net::Amazon::S3
Fetching http://www.cpan.org/authors/id/L/LL/LLAP/Net-Amazon-S3-0.89.tar.gz
-> OK
Unpacking Net-Amazon-S3-0.89.tar.gz
Entering Net-Amazon-S3-0.89
Checking configure dependencies from META.json
Checking if you have ExtUtils::MakeMaker 6.58 ... Yes (7.44)
Configuring Net-Amazon-S3-0.89
Running Makefile.PL
Checking if your kit is complete...
Looks good
Generating a gmake-style Makefile
Writing Makefile for Net::Amazon::S3
Writing MYMETA.yml and MYMETA.json
-> OK
Checking dependencies from MYMETA.json ...
Checking if you have Moose::Meta::Class 0 ... Yes (2.2012)
Checking if you have Digest::MD5 0 ... Yes (2.55)
Checking if you have strict 0 ... Yes (1.11)
Checking if you have Sub::Override 0 ... Yes (0.09)
Checking if you have HTTP::Date 0 ... Yes (6.05)
Checking if you have Test::More 0 ... Yes (1.302172)
Checking if you have Test::MockTime 0 ... Yes (0.17)
Checking if you have Moose::Object 0 ... Yes (2.2012)
Checking if you have Term::Encoding 0 ... Yes (0.03)
Checking if you have DateTime::Format::HTTP 0 ... Yes (0.42)
Checking if you have Exporter::Tiny 0 ... Yes (1.002001)
Checking if you have Carp 0 ... Yes (1.50)
Checking if you have Moose::Util 0 ... Yes (2.2012)
Checking if you have File::Temp 0 ... Yes (0.2309)
Checking if you have MIME::Types 0 ... Yes (2.17)
Checking if you have Path::Class 0 ... Yes (0.37)
Checking if you have Term::ProgressBar::Simple 0 ... Yes (0.03)
Checking if you have Moose 0.85 ... Yes (2.2012)
Checking if you have MooseX::Role::Parameterized 0 ... Yes (1.11)
Checking if you have MooseX::Types::DateTime::MoreCoercions 0.07 ... Yes (0.15)
Checking if you have URI::Escape 0 ... Yes (3.31)
Checking if you have MIME::Base64 0 ... Yes (3.15)
Checking if you have MooseX::StrictConstructor 0.16 ... Yes (0.21)
Checking if you have Digest::MD5::File 0 ... Yes (0.08)
Checking if you have sort 0 ... Yes (2.04)
Checking if you have Test::Deep 0 ... Yes (1.130)
Checking if you have FindBin 0 ... Yes (1.51)
Checking if you have parent 0 ... Yes (0.238)
Checking if you have Scalar::Util 0 ... Yes (1.54)
Checking if you have Hash::Util 0 ... Yes (0.22)
Checking if you have Moose::Util::TypeConstraints 0 ... Yes (2.2012)
Checking if you have namespace::clean 0 ... Yes (0.27)
Checking if you have XML::LibXML::XPathContext 0 ... Yes (2.0203)
Checking if you have Digest::HMAC_SHA1 0 ... Yes (1.03)
Checking if you have File::stat 0 ... Yes (1.08)
Checking if you have vars 0 ... Yes (1.05)
Checking if you have Time::Piece 0 ... Yes (1.34)
Checking if you have Test::LoadAllModules 0 ... Yes (0.022)
Checking if you have IO::File 1.14 ... Yes (1.41)
Checking if you have Test::Warnings 0 ... Yes (0.029)
Checking if you have HTTP::Status 0 ... Yes (6.22)
Checking if you have warnings 0 ... Yes (1.44)
Checking if you have URI::QueryParam 0 ... Yes (1.76)
Checking if you have LWP 6.03 ... Yes (6.43)
Checking if you have Getopt::Long 0 ... Yes (2.51)
Checking if you have Regexp::Common 0 ... Yes (2017060201)
Checking if you have LWP::Simple 0 ... Yes (6.43)
Checking if you have File::Find::Rule 0 ... Yes (0.34)
Checking if you have Test::Exception 0 ... Yes (0.43)
Checking if you have URI 0 ... Yes (1.76)
Checking if you have Moose::Role 0 ... Yes (2.2012)
Checking if you have Ref::Util 0 ... Yes (0.204)
Checking if you have ExtUtils::MakeMaker 0 ... Yes (7.44)
Checking if you have Data::Stream::Bulk::Callback 0 ... Yes (0.11)
Checking if you have XML::LibXML 0 ... Yes (2.0203)
Checking if you have HTTP::Response 0 ... Yes (6.22)
Checking if you have lib 0 ... Yes (0.65)
Checking if you have Pod::Usage 0 ... Yes (1.70)
Checking if you have Digest::SHA 0 ... Yes (6.02)
Checking if you have LWP::UserAgent::Determined 0 ... Yes (1.07)
Building and testing Net-Amazon-S3-0.89
cp lib/Net/Amazon/S3/Client/Object.pm blib\lib\Net\Amazon\S3\Client\Object.pm
cp lib/Net/Amazon/S3/Request/CompleteMultipartUpload.pm blib\lib\Net\Amazon\S3\Request\CompleteMultipartUpload.pm
cp lib/Net/Amazon/S3/Bucket.pm blib\lib\Net\Amazon\S3\Bucket.pm
cp lib/Net/Amazon/S3/Request/Bucket.pm blib\lib\Net\Amazon\S3\Request\Bucket.pm
cp lib/Net/Amazon/S3/Features.pod blib\lib\Net\Amazon\S3\Features.pod
cp lib/Net/Amazon/S3.pm blib\lib\Net\Amazon\S3.pm
cp lib/Net/Amazon/S3/Request.pm blib\lib\Net\Amazon\S3\Request.pm
cp lib/Net/Amazon/S3/Client.pm blib\lib\Net\Amazon\S3\Client.pm
cp lib/Net/Amazon/S3/HTTPRequest.pm blib\lib\Net\Amazon\S3\HTTPRequest.pm
cp lib/Net/Amazon/S3/Request/DeleteObject.pm blib\lib\Net\Amazon\S3\Request\DeleteObject.pm
cp lib/Net/Amazon/S3/Request/AbortMultipartUpload.pm blib\lib\Net\Amazon\S3\Request\AbortMultipartUpload.pm
cp lib/Net/Amazon/S3/Request/DeleteBucket.pm blib\lib\Net\Amazon\S3\Request\DeleteBucket.pm
cp lib/Net/Amazon/S3/Client/Bucket.pm blib\lib\Net\Amazon\S3\Client\Bucket.pm
cp lib/Net/Amazon/S3/Request/CreateBucket.pm blib\lib\Net\Amazon\S3\Request\CreateBucket.pm
cp lib/Net/Amazon/S3/Request/DeleteMultiObject.pm blib\lib\Net\Amazon\S3\Request\DeleteMultiObject.pm
cp lib/Net/Amazon/S3/Request/ListAllMyBuckets.pm blib\lib\Net\Amazon\S3\Request\ListAllMyBuckets.pm
cp lib/Net/Amazon/S3/Request/ListBucket.pm blib\lib\Net\Amazon\S3\Request\ListBucket.pm
cp lib/Net/Amazon/S3/Request/Role/HTTP/Header/Acl_short.pm blib\lib\Net\Amazon\S3\Request\Role\HTTP\Header\Acl_short.pm
cp lib/Net/Amazon/S3/Request/GetBucketLocationConstraint.pm blib\lib\Net\Amazon\S3\Request\GetBucketLocationConstraint.pm
cp lib/Net/Amazon/S3/Request/GetBucketAccessControl.pm blib\lib\Net\Amazon\S3\Request\GetBucketAccessControl.pm
cp lib/Net/Amazon/S3/Request/Role/HTTP/Header.pm blib\lib\Net\Amazon\S3\Request\Role\HTTP\Header.pm
cp lib/Net/Amazon/S3/Request/Object.pm blib\lib\Net\Amazon\S3\Request\Object.pm
cp lib/Net/Amazon/S3/Request/GetObject.pm blib\lib\Net\Amazon\S3\Request\GetObject.pm
cp lib/Net/Amazon/S3/Request/GetObjectAccessControl.pm blib\lib\Net\Amazon\S3\Request\GetObjectAccessControl.pm
cp lib/Net/Amazon/S3/Request/PutPart.pm blib\lib\Net\Amazon\S3\Request\PutPart.pm
cp lib/Net/Amazon/S3/Request/ListParts.pm blib\lib\Net\Amazon\S3\Request\ListParts.pm
cp lib/Net/Amazon/S3/Request/PutObject.pm blib\lib\Net\Amazon\S3\Request\PutObject.pm
cp lib/Net/Amazon/S3/Request/InitiateMultipartUpload.pm blib\lib\Net\Amazon\S3\Request\InitiateMultipartUpload.pm
cp lib/Net/Amazon/S3/Request/Role/HTTP/Header/Content_length.pm blib\lib\Net\Amazon\S3\Request\Role\HTTP\Header\Content_length.pm
cp lib/Net/Amazon/S3/Request/Role/HTTP/Method.pm blib\lib\Net\Amazon\S3\Request\Role\HTTP\Method.pm
cp lib/Net/Amazon/S3/Request/Role/HTTP/Method/GET.pm blib\lib\Net\Amazon\S3\Request\Role\HTTP\Method\GET.pm
cp lib/Net/Amazon/S3/Request/Role/HTTP/Header/Encryption.pm blib\lib\Net\Amazon\S3\Request\Role\HTTP\Header\Encryption.pm
cp lib/Net/Amazon/S3/Request/Role/HTTP/Header/Copy_source.pm blib\lib\Net\Amazon\S3\Request\Role\HTTP\Header\Copy_source.pm
cp lib/Net/Amazon/S3/Request/Role/HTTP/Method/PUT.pm blib\lib\Net\Amazon\S3\Request\Role\HTTP\Method\PUT.pm
cp lib/Net/Amazon/S3/Request/Role/Query/Action.pm blib\lib\Net\Amazon\S3\Request\Role\Query\Action.pm
cp lib/Net/Amazon/S3/Request/Role/HTTP/Header/Content_md5.pm blib\lib\Net\Amazon\S3\Request\Role\HTTP\Header\Content_md5.pm
cp lib/Net/Amazon/S3/Request/Role/HTTP/Method/POST.pm blib\lib\Net\Amazon\S3\Request\Role\HTTP\Method\POST.pm
cp lib/Net/Amazon/S3/Request/Role/HTTP/Header/Content_type.pm blib\lib\Net\Amazon\S3\Request\Role\HTTP\Header\Content_type.pm
cp lib/Net/Amazon/S3/Request/Role/HTTP/Method/DELETE.pm blib\lib\Net\Amazon\S3\Request\Role\HTTP\Method\DELETE.pm
cp lib/Net/Amazon/S3/Request/Role/Query/Param/Delimiter.pm blib\lib\Net\Amazon\S3\Request\Role\Query\Param\Delimiter.pm
cp lib/Net/Amazon/S3/Request/Role/Query/Action/Location.pm blib\lib\Net\Amazon\S3\Request\Role\Query\Action\Location.pm
cp lib/Net/Amazon/S3/Request/Role/Query/Action/Acl.pm blib\lib\Net\Amazon\S3\Request\Role\Query\Action\Acl.pm
cp lib/Net/Amazon/S3/Request/Role/Query/Action/Uploads.pm blib\lib\Net\Amazon\S3\Request\Role\Query\Action\Uploads.pm
cp lib/Net/Amazon/S3/Request/Role/Query/Param/Marker.pm blib\lib\Net\Amazon\S3\Request\Role\Query\Param\Marker.pm
cp lib/Net/Amazon/S3/Request/Role/Query/Action/Delete.pm blib\lib\Net\Amazon\S3\Request\Role\Query\Action\Delete.pm
cp lib/Net/Amazon/S3/Request/Role/Query/Param/Upload_id.pm blib\lib\Net\Amazon\S3\Request\Role\Query\Param\Upload_id.pm
cp lib/Net/Amazon/S3/Request/Role/Query/Param/Part_number.pm blib\lib\Net\Amazon\S3\Request\Role\Query\Param\Part_number.pm
cp lib/Net/Amazon/S3/Request/Role/Query/Param/Max_keys.pm blib\lib\Net\Amazon\S3\Request\Role\Query\Param\Max_keys.pm
cp lib/Net/Amazon/S3/Request/Role/Query/Param/Prefix.pm blib\lib\Net\Amazon\S3\Request\Role\Query\Param\Prefix.pm
cp lib/Net/Amazon/S3/Request/Role/Query/Param.pm blib\lib\Net\Amazon\S3\Request\Role\Query\Param.pm
cp lib/Net/Amazon/S3/Signature/V4.pm blib\lib\Net\Amazon\S3\Signature\V4.pm
cp lib/Net/Amazon/S3/Request/SetObjectAccessControl.pm blib\lib\Net\Amazon\S3\Request\SetObjectAccessControl.pm
cp lib/Net/Amazon/S3/Request/Service.pm blib\lib\Net\Amazon\S3\Request\Service.pm
cp lib/Net/Amazon/S3/Signature.pm blib\lib\Net\Amazon\S3\Signature.pm
cp lib/Net/Amazon/S3/Role/Bucket.pm blib\lib\Net\Amazon\S3\Role\Bucket.pm
cp lib/Shared/Examples/Net/Amazon/S3/API.pm blib\lib\Shared\Examples\Net\Amazon\S3\API.pm
cp lib/Shared/Examples/Net/Amazon/S3/Operation/Bucket/Create.pm blib\lib\Shared\Examples\Net\Amazon\S3\Operation\Bucket\Create.pm
cp lib/Shared/Examples/Net/Amazon/S3/Client.pm blib\lib\Shared\Examples\Net\Amazon\S3\Client.pm
cp lib/Shared/Examples/Net/Amazon/S3/Error.pm blib\lib\Shared\Examples\Net\Amazon\S3\Error.pm
cp lib/Net/Amazon/S3/Signature/V2.pm blib\lib\Net\Amazon\S3\Signature\V2.pm
cp lib/Shared/Examples/Net/Amazon/S3/ACL.pm blib\lib\Shared\Examples\Net\Amazon\S3\ACL.pm
cp lib/Shared/Examples/Net/Amazon/S3.pm blib\lib\Shared\Examples\Net\Amazon\S3.pm
cp lib/Net/Amazon/S3/Request/SetBucketAccessControl.pm blib\lib\Net\Amazon\S3\Request\SetBucketAccessControl.pm
cp lib/Net/Amazon/S3/Signature/V4Implementation.pm blib\lib\Net\Amazon\S3\Signature\V4Implementation.pm
cp lib/Shared/Examples/Net/Amazon/S3/Operation/Bucket/Objects/List.pm blib\lib\Shared\Examples\Net\Amazon\S3\Operation\Bucket\Objects\List.pm
cp lib/Shared/Examples/Net/Amazon/S3/Request.pm blib\lib\Shared\Examples\Net\Amazon\S3\Request.pm
cp lib/Shared/Examples/Net/Amazon/S3/Operation/Bucket/Objects/Delete.pm blib\lib\Shared\Examples\Net\Amazon\S3\Operation\Bucket\Objects\Delete.pm
cp lib/Shared/Examples/Net/Amazon/S3/Operation/Service/Buckets/List.pm blib\lib\Shared\Examples\Net\Amazon\S3\Operation\Service\Buckets\List.pm
"C:\Strawberry\perl\bin\perl.exe" -MExtUtils::Command -e cp -- bin/s3cl blib\script\s3cl
pl2bat.bat blib\script\s3cl
"C:\Strawberry\perl\bin\perl.exe" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib\lib', 'blib\arch')" t/*.t
    # No tests run!

#   Failed test 'No tests run for subtest "use_ok"'
#   at t/00use.t line 16.
Can't locate Win32.pm in @INC (you may need to install the Win32 module) (@INC contains: lib) at C:/Strawberry/perl/lib/Cwd.pm line 605.
BEGIN failed--compilation aborted.
# Looks like your test exited with 255 just after 2.
t/00use.t ................................... 
Dubious, test returned 255 (wstat 65280, 0xff00)
Failed 1/2 subtests 
t/01api.t ................................... skipped: Testing this module for real costs money. Enable it by setting true value to env variable AMAZON_S3_EXPENSIVE_TESTS
t/02client.t ................................ skipped: Testing this module for real costs money.
t/03token.t ................................. skipped: Need these vars in ENV: AWS_ACCESS_KEY_ID, AWS_ACCESS_KEY_SECRET, AWS_ACCESS_TOKEN
t/api-bucket-acl-get.t ...................... ok
t/api-bucket-acl-set.t ...................... ok
t/api-bucket-create.t ....................... ok
t/api-bucket-delete.t ....................... ok
t/api-bucket-objects-delete.t ............... ok
t/api-bucket-objects-list.t ................. ok
t/api-object-acl-get.t ...................... ok
t/api-object-acl-set.t ...................... ok
t/api-object-create.t ....................... ok
t/api-object-delete.t ....................... ok
t/api-object-fetch.t ........................ ok
t/api-object-head.t ......................... ok
t/api-service-buckets-list.t ................ ok
t/client-bucket-acl-get.t ................... ok
t/client-bucket-create.t .................... ok
t/client-bucket-delete.t .................... ok
t/client-bucket-objects-delete.t ............ ok
t/client-bucket-objects-list.t .............. ok
t/client-object-create.t .................... ok
t/client-object-delete.t .................... ok
t/client-object-fetch.t ..................... ok
t/client-service-buckets-list.t ............. ok
t/query-string-authentication-uri.t ......... ok
t/request-abort-multipart-upload.t .......... ok
t/request-complete-multipart-upload.t ....... ok
t/request-create-bucket.t ................... ok
t/request-delete-bucket.t ................... ok
t/request-delete-multi-object.t ............. ok
t/request-delete-object.t ................... ok
t/request-get-bucket-access-control.t ....... ok
t/request-get-bucket-location-constraint.t .. ok
t/request-get-object-access-control.t ....... ok
t/request-get-object.t ...................... ok
t/request-initiate-multipart-upload.t ....... ok
t/request-list-all-buckets.t ................ ok
t/request-list-bucket.t ..................... ok
t/request-list-parts.t ...................... ok
t/request-put-object.t ...................... ok
t/request-put-part.t ........................ ok
t/request-set-bucket-access-control.t ....... ok
t/request-set-object-access-control.t ....... ok
t/request.t ................................. ok
t/signature-v4-with-security-token.t ........ ok

Test Summary Report
-------------------
t/00use.t                                 (Wstat: 65280 Tests: 2 Failed: 1)
  Failed test:  1
  Non-zero exit status: 255
Files=47, Tests=199, 60 wallclock secs ( 0.16 usr +  0.23 sys =  0.39 CPU)
Result: FAIL
Failed 1/47 test programs. 1/199 subtests failed.
gmake: *** [Makefile:1052: test_dynamic] Error 255
-> FAIL Installing Net::Amazon::S3 failed. See C:\Users\MyUsername\.cpanm\work\1595972364.5912\build.log for details. Retry with --force to force install it.

日志显示“无法在 @INC 中找到 Win32.pm(您可能需要安装 Win32 模块)”所以我使用 CPAN 安装了它

λ cpanm Win32
Win32 is up to date. (0.54)

但我还是无法成功安装Net::Amazon::S3

【问题讨论】:

(@INC contains: lib) 嗯,这不对。 是的,这只是一个糟糕的测试。它使用 Test::LoadAllModules,它以不可接受的方式更改 @INC。您可以安全地强制安装 (cpanm -f Net::Amazon::S3),因为所有其他测试都通过了。 @ikegami 好的,我试试看。你知道为什么包里有不好的测试吗?这是 perl 软件包经常发生的事情吗? 这不应该发生。有自动化测试可以测试 CPAN 上的所有内容并发送失败报告。我不知道这里的所有细节,因此缺乏答案。我现在正在做其他事情。我通常会发现问题并提交错误票 【参考方案1】:

这是用于执行测试的模块中的bug。该错误导致 Windows 上的测试失败,但并不表示正在安装的任何模块存在问题。这是测试的问题,而不是被测试的模块。

将以下内容添加到t\00use.t 将允许测试运行:

use Win32;

但这并不是真正必要的。如果这是唯一失败的测试,那么忽略此测试失败并强制安装模块应该是安全的(通过将-f 传递给cpan/cpanm)。

Net-Amazon-S3 已经notified 提出了这个问题以及如何解决它。

【讨论】:

以上是关于无法安装 Net::Amazon::S3的主要内容,如果未能解决你的问题,请参考以下文章

安装 s3fs(保险丝)驱动器的 FFMPEG 问题“无法将文件 __.stream.tmp 重命名为 __.stream:不支持操作”

无法将 Nativescript 图像上传到 S3

ESXI6.0 ESXI6.0安装时无法安装网卡驱动的解决方法及将网卡驱动加载进ISO

Sonata + Amazon S3 - 无法编写关键内容

Apache zeppelin 无法从 Amazon S3 笔记本 json 文件中获取 URL

无法将我的凭据传递给AWS PHP SDK