gpt4 book ai didi

windows - 无法安装时间:Piece module with cpan

转载 作者:可可西里 更新时间:2023-11-01 10:21:45 27 4
gpt4 key购买 nike

我需要在 Perl 中安装 Time::Piece 模块。由于某种原因它不在那里。当我使用

cpan install Time::Piece

在一些成功的步骤之后,我得到了下面的错误

.....
Checking if your kit is complete...
Looks good
Unable to find a perl 5 (by these names: "My windows path variable contents here...i think"
Writing Makefile for Time::Piece
'nmake' is not recognized as an internal or external command,
operable program or batch file.
RJBS/Time-Piece-1.29.tar.gz
nmake -- NOT OK
Running make test
Can't test without successful make
Running make install
Make had returned bad status, install seems impossible
Failed during this command:
RJBS/Time-Piece-1.29.tar.gz : make NO

cpan[2]>

为什么会这样?请帮助我修复它。


我会在尝试自己修复它的同时等待答案。第一个问题 -

'nmake' is not recognized as an internal or external command, operable program or batch file.

我用了this solution

Windows 7 Control Panel, Programs and Features, Select Microsoft Visual Studio 2008 Standard or Professional Edition application then choose Uninstall/Change/Modify. This will bring you into Maintenance Mode. Select C++ then check X64 Compilers and Tools.

我有 Visual Studio Express 和 Visual Studio Professional 2013(我不记得它是如何或为什么在我的系统上的。)我按照上述说明进行操作。选项不同:其中一个选项中提到了 C++ - Microsoft Visual C++ 2013 Microsoft Foundation Class Libraries。所以,我选择了那个。它需要 600MB 的下载和安装。

我转到 C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin 并在那里找到了 nmake。如果您在那里找不到它,那么您可能会在 Microsoft Visual Studio 10、11 等中找到它。在那里寻找 nmake。将 nmake 的路径添加到 PATH 环境变量中。

现在,我得到一个新的错误

NMAKE : fatal error U1073: don't know how to make 'C:/Program'
Stop.
RJBS/Time-Piece-1.29.tar.gz
nmake -- NOT OK
Running make test
Can't test without successful make
Running make install
Make had returned bad status, install seems impossible
Failed during this command:
RJBS/Time-Piece-1.29.tar.gz : make NO

cpan[2]>

我也会尝试修复这个问题。顺便说一句,@ikegami 告诉我安装到没有空格的路径 (C:\progs\...) 将解决我的问题。我无法安装到另一个目录:

This version of Perl comes bundled with other software which must install to the folder "C:\Program Files (x86)" which has a space in it. The software needs to be in that path for some other things to work correctly. Is there a simple way to edit the code which is trying to install the modules? I could make it parse the path by changing some code. I am new to Perl though. Not sure if I'll be able to change without causing harm .

编辑 -

我同时拥有 Active state perl 5.1.2 和 perl 5.8,它们由工具 x 和工具 y(电动指挥官)使用。工具 y 有自己的 perl 库,我的代码中必须使用这些库。所以我坚持使用 perl 5.8。

我才知道这是由于工具 y 的问题。有一个解决方法,但我无法理解。你能帮我理解 Windows 的解决方法吗?

https://electriccloud.zendesk.com/hc/en-us/articles/202828073-KBEC-00180-Installing-Perl-modules-into-the-Commander-Perl-distribution

最佳答案

您正在运行哪个版本的 Perl?如果在命令提示符下运行“perl -v”会得到什么?

如果您获得的版本号是 5.10 或更高,那么 Time::Piece 应该已经包含在该版本的 Perl 中。如果不是,那么您的安装会以有趣的方式损坏,您可能应该从头开始重新安装。

如果您获得的版本号低于 5.10,那么您安装的 Perl 版本非常旧,最好的方法是升级到较新的版本。

关于windows - 无法安装时间:Piece module with cpan,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27210421/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com