--force command in perl will install modules for sure? [duplicate] - perl

This question already has an answer here:
Dmake file error with Math::TrulyRandom module
(1 answer)
Closed 6 years ago.
I tried installing [Math::TrulyRandom][1] a random (versus pseudo random) number generator, and on cpan.org, there is only the source code available. My first attempt of installing it was a failure, and then told me to use the --force so that it will be installed the second time. My second time is a failure as well. Can someone explain if I used the --force command correctly, or if there is another way to install Math::TrulyRandom? Thanks in advance.
C:\Users\Jlinne\Documents> cpanm Math::TrulyRandom
--> Working on Math::TrulyRandom
Fetching http://www.cpan.org/authors/id/G/GA/GARY/Math-TrulyRandom-1.0.tar.gz ... OK
Configuring Math-TrulyRandom-1.0 ... OK
Building and testing Math-TrulyRandom-1.0 ... FAIL
! Installing Math::TrulyRandom failed. See C:\Users\Jlinne\.cpanm\work\1476406246.12316\build.log for details. Retry with --force to force install it.
C:\Users\Jlinne\Documents> cpanm --force Math::TrulyRandom
--> Working on Math::TrulyRandom
Fetching http://www.cpan.org/authors/id/G/GA/GARY/Math-TrulyRandom-1.0.tar.gz ... OK
Configuring Math-TrulyRandom-1.0 ... OK
Building and testing Math-TrulyRandom-1.0 ... FAIL
! Installing Math::TrulyRandom failed. See C:\Users\Jlinne\.cpanm\work\1476406259.5096\build.log for details. Retry with --force to force install it.
I also tried this, but I do not understand what this means (eg. the second to last line of code):
C:\Users\Jlinne\.cpanm\work\1476412047.4284\Math-TrulyRandom-1.0>exit
Building Math-TrulyRandom-1.0 failed.
You can s)kip, r)etry, e)xamine build log, or l)ook ? [s] e
FAIL
! You don't seem to have a PAGER :/
Building Math-TrulyRandom-1.0 failed.
Output:
C:\Users\Jlinne\Documents> cpanm Math::TrulyRandom
--> Working on Math::TrulyRandom
Fetching http://www.cpan.org/authors/id/G/GA/GARY/Math-TrulyRandom-1.0.tar.gz ... OK
Configuring Math-TrulyRandom-1.0 ... OK
Building and testing Math-TrulyRandom-1.0 ... FAIL
! Installing Math::TrulyRandom failed. See C:\Users\Jlinne\.cpanm\work\1476549822.10400\build.log for details. Retry with --force to force install it.
C:\Users\Jlinne\Documents> cpanm --prompt Math::TrulyRandom
--> Working on Math::TrulyRandom
Fetching http://www.cpan.org/authors/id/G/GA/GARY/Math-TrulyRandom-1.0.tar.gz ... OK
Configuring Math-TrulyRandom-1.0 ... OK
Building and testing Math-TrulyRandom-1.0 ... Building Math-TrulyRandom-1.0 failed.
You can s)kip, r)etry, e)xamine build log, or l)ook ? [s] l
Entering C:/Users/Jlinne/.cpanm/work/1476549847.11132/Math-TrulyRandom-1.0 with C:\WINDOWS\system32\cmd.exe
Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.
C:\Users\Jlinne\.cpanm\work\1476549847.11132\Math-TrulyRandom-1.0>perl Makefile.PL
Generating a dmake-style Makefile
Writing Makefile for Math::TrulyRandom
Writing MYMETA.yml and MYMETA.json
C:\Users\Jlinne\.cpanm\work\1476549847.11132\Math-TrulyRandom-1.0>nmake
'nmake' is not recognized as an internal or external command,
operable program or batch file.
C:\Users\Jlinne\.cpanm\work\1476549847.11132\Math-TrulyRandom-1.0>

It likely failed in the building phase and not the testing phase. The --force option just allows cpanm to ignore the results of tests. You should also almost never use --force. Use --prompt instead, and then choose the look option when prompted. Once it drops you in the build directory, run perl Build.pl or perl Makefile.PL (whichever the module uses). Look for and, if you can, fix them. If you can't fix them, ask about them on SO. If it creates a makefile, then run nmake. Look for errors, etc. Then run nmake test. Look for errors, etc. Once all of that works, exit the shell and you will be returned to the prompt. Chose retry and it should install.
You could also just look at the build log and see what went wrong: C:\Users\Jlinne.cpanm\work\1476406259.5096\build.log
I also just noticed you are using MS Windows, are you sure you have a valid build environment (ie nmake is installed, you have a C compiler, etc)?

Related

How install TCOD::Key with Straberry perl (windows 10)

I have got Strawberry perl with windows 10. Using cpan I try to install TCOD::Key. The problem is the libtcod.h file is absent. I do not understand how install the libraria.
D:\Documents>cpanm --force TCOD::Key
--> Working on TCOD::Key
Fetching http://www.cpan.org/authors/id/J/JJ/JJATRIA/TCOD-0.009.tar.gz ... OK
Configuring TCOD-0.009 ... OK
Building and testing TCOD-0.009 ... FAIL
! Installing TCOD::Key failed. See C:\Users\User\.cpanm\work\1672857094.2144\build.log for details. Retry with --force to force install it.
screenshot
I expect that by installing the library, the TSOD::Key module will install successfully.

Cannot Install ExtUtils::MakeMaker in Strawberry Perl

I am trying to install GD and Chart to Strawberry Perl in a Windows 10 Pro PC (using CPANM). Both GD and Chart requires a dependency called ExtUtils::MakeMaker. Unfortunately MakeMaker fails to be install and I cannot tell what the error is. I hope someone can understand the error message and tell me what goes wrong.
That is how I try to install Chart and the few error message that I get:
cpanm Chart
--> Working on Chart
Fetching http://www.cpan.org/authors/id/L/LI/LICHTKIND/Chart-v2.402.1.tar.gz ... OK
==> Found dependencies: ExtUtils::MakeMaker
--> Working on ExtUtils::MakeMaker
Fetching http://www.cpan.org/authors/id/B/BI/BINGOS/ExtUtils-MakeMaker-7.64.tar.gz ... OK
Configuring ExtUtils-MakeMaker-7.64 ... N/A
! Configure failed for ExtUtils-MakeMaker-7.64. See C:\Users\..user-name..\.cpanm\work\1655122864.2228\build.log for details.
Configuring Chart-v2.402.1 ... N/A
! Configure failed for Chart-v2.402.1. See C:\Users\..user-name..\.cpanm\work\1655122864.2228\build.log for details.
The build.log says this:
cpanm (App::cpanminus) 1.7046 on perl 5.012003 built for MSWin32-x86-multi-thread
Work directory is C:\Users\..user-name../.cpanm/work/1655122864.2228
You have make C:\Strawberry\c\bin\dmake.exe
You have LWP 6.02
Falling back to Archive::Tar 1.76
Searching Chart () on cpanmetadb ...
--> Working on Chart
Fetching http://www.cpan.org/authors/id/L/LI/LICHTKIND/Chart-v2.402.1.tar.gz
-> OK
Unpacking Chart-v2.402.1.tar.gz
Entering Chart-v2.402.1
Checking configure dependencies from META.json
Checking if you have ExtUtils::MakeMaker 6.58 ... No (6.56 < 6.58)
==> Found dependencies: ExtUtils::MakeMaker
Searching ExtUtils::MakeMaker (6.58) on cpanmetadb ...
--> Working on ExtUtils::MakeMaker
Fetching http://www.cpan.org/authors/id/B/BI/BINGOS/ExtUtils-MakeMaker-7.64.tar.gz
-> OK
Unpacking ExtUtils-MakeMaker-7.64.tar.gz
Entering ExtUtils-MakeMaker-7.64
Checking configure dependencies from META.json
Configuring ExtUtils-MakeMaker-7.64
Running Makefile.PL
-> N/A
-> FAIL Configure failed for ExtUtils-MakeMaker-7.64. See C:\Users\..user-name..\.cpanm\work\1655122864.2228\build.log for details.
Configuring Chart-v2.402.1
Running Makefile.PL
-> N/A
-> FAIL Configure failed for Chart-v2.402.1. See C:\Users\..user-name..\.cpanm\work\1655122864.2228\build.log for details.
Please let me know what goes wrong and how to fix this problem. If there is no solution to this problem, I would like to know if there is any workaround. Thanks.
UPDATE 1: I installed the latest version of Perl (5.32.1.1). Unfortunately I still cannot install the dependency MakeMaker for Chart library. The content in the build.log after trying to install Chart is:
cpanm (App::cpanminus) 1.7046 on perl 5.032001 built for MSWin32-x86-multi-thread-64int
Work directory is C:\Users\...user-name.../.cpanm/work/1655143835.7588
You have make C:\Strawberry\c\bin\gmake.exe
You have LWP 6.52
Falling back to Archive::Tar 2.38
Searching Chart () on cpanmetadb ...
--> Working on Chart
Fetching http://www.cpan.org/authors/id/L/LI/LICHTKIND/Chart-v2.402.1.tar.gz
-> OK
Unpacking Chart-v2.402.1.tar.gz
Entering Chart-v2.402.1
Checking configure dependencies from META.json
Checking if you have ExtUtils::MakeMaker 6.58 ... Yes (7.58)
Configuring Chart-v2.402.1
Running Makefile.PL
-> N/A
-> FAIL Configure failed for Chart-v2.402.1. See C:\Users\...user-name...\.cpanm\work\1655143835.7588\build.log for details.
UPDATE 2: I used the -v switch with CPANM to install Chart, and this somehow worked fine. I don't know why -v switch can make a difference. But I am glad that this works for installing Chart. Now Chart is successfully installed. Unfortunately when I try to install GD using the -v switch, I run into the same error.
The build.log of my latest attempt is the following:
cpanm (App::cpanminus) 1.7046 on perl 5.032001 built for MSWin32-x86-multi-thread-64int
Work directory is C:\Users\...user-name.../.cpanm/work/1655147078.2428
You have make C:\Strawberry\c\bin\gmake.exe
You have LWP 6.52
Falling back to Archive::Tar 2.38
Searching GD () on cpanmetadb ...
--> Working on GD
Fetching http://www.cpan.org/authors/id/R/RU/RURBAN/GD-2.76.tar.gz
-> OK
Unpacking GD-2.76.tar.gz
Entering GD-2.76
Checking configure dependencies from META.json
Checking if you have ExtUtils::PkgConfig 0 ... Yes (1.16)
Checking if you have ExtUtils::Constant 0.22 ... Yes (0.25)
Configuring GD-2.76
Running Makefile.PL
-> N/A
-> FAIL Configure failed for GD-2.76. See C:\Users\...user-name...\.cpanm\work\1655147078.2428\build.log for details.
Please note that the build.log mentioned in the last line above is the same build.log that I have posted right above. I don't know why it refers to itself. I mention this just in case someone wants to see the "real" build.log.
UPDATE 3: Finally with the help from Håkon Hægland, I figured out that the PATH of the computer was missing several paths (namely C:\Windows;C:\Windows\System32;C:\Windows\System32\Wbem). I added the missing paths to PATH, and the installation is successful. I have no idea why those important paths would go missing. But I am glad that the installation of GD and Chart are successful.
With the help from Håkon Hægland, I finally figured out that the PATH of the computer somehow was missing several important paths, namely C:\Windows, C:\Windows\System32, and C:\Windows\System32\Wbem. This explains the reason why CPANM failed to install GD and Chart. It probably could not get access to a command to install the distribution or its dependency. After I have added the missing paths to PATH, I have no problem using CPANM to install GD and Chart.
As of why those paths were missing from PATH, I have no idea. I don't recall this problem ever happened to me.
As of why I could use CPANM to install Chart using the -v switch despite the fact that the paths were missing, I have no idea either.

Trying to install a perl module with cpanm, got a fail

So I just installed Strawberry Perl and now I want to get the following module:
https://metacpan.org/pod/Lingua::EN::CMUDict
So I typed in "cpanm Lingua::EN::CMUDict" and got:
So I tried again with "cpanm Lingua::EN::CMUDict --force" and got the same exact thing.
Here are the contents of the log in question:
cpanm (App::cpanminus) 1.7044 on perl 5.032001 built for MSWin32-x64-multi-thread
Work directory is C:\Users\matth/.cpanm/work/1630544096.16456
You have make C:\Users\c\bin\gmake.exe
You have LWP 6.52
Falling back to Archive::Tar 2.38
==============
Tried verbose output, got this:
--> Working on Lingua::EN::CMUDict
Fetching http://www.cpan.org/authors/id/L/LM/LMETCALF/Lingua-EN-CMUDict-0.06.tar.gz ... OK
Configuring Lingua-EN-CMUDict-0.06 ... OK
Building and testing Lingua-EN-CMUDict-0.06 ... FAIL
! Installing Lingua::EN::CMUDict failed. See C:\Users\matth\.cpanm\work\1630595312.29316\build.log for details. Retry with --force to force install it.
! Finding Write-Verbose on cpanmetadb failed.
! Finding Write-Verbose () on mirror http://www.cpan.org failed.
! Couldn't find module or a distribution Write-Verbose
And that log:
https://pastebin.com/iSS5LRKA
Also, it says my File::ShareDir is up to date.
I have installed the file manually, and put it in perl\lib, but it says it doesn't exist. Where should I put it?
I looked up the module in CPAN and under Kwalitee issues I found:
prereq_matches_use
List all used modules in META.yml requires
Error:
File::ShareDir
When I downloaded (but not installed) the module I found this in the code
(in Lingua/EN/CMUDict.pm): use File::ShareDir ':ALL'
So maybe the installation is missing this module and you could try to install it yourself.
It was Håkon Hægland that helped. As soon as I changed the permission to lib, it worked.

cpan "Set::IntervalTree " or "Algorithm::ExpectationMaximization" doesn't work - I explain below the complete error log

Here I explain more about troubles installing some Perl libraries:
trouble installing Set::IntervalTree
** I installed g++ - still the same issue
** I installed miniconda, and tried to conda the package - still having the same issue
here are the complete error logs:
** I copy part of it - as it is too long!
cpan Set::IntervalTree
Can't locate ExtUtils/CppGuess.pm in #INC (#INC contains: C:/Strawberry/perl/site/lib C:/Strawberry/perl/vendor/lib C:/Strawberry/perl/lib .) at Makefile.PL line 11.
BEGIN failed--compilation aborted at Makefile.PL line 11.
Warning: No success on command[C:\Strawberry\perl\bin\perl.exe Makefile.PL]
SLOYD/Set-IntervalTree-0.12.tar.gz
C:\Strawberry\perl\bin\perl.exe Makefile.PL -- NOT OK
Running make test
Make had some problems, won't test
Running make install
Make had some problems, won't install
I face similar problem trying to cpan Algorithm::ExpectationMaximization
one dependency not OK (Math::GSL); additionally test harness failed
C:\Strawberry\c\bin\dmake.EXE test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
reports AVIKAK/Algorithm-ExpectationMaximization-1.22.tar.gz
Running make install
make test had returned bad status, won't install without force
Suggestions:
Create a gist of the full log and post the link to it here. If you are philosophically opposed to GitHub, I believe there are other places you could post, but I don't know how permanent they are.
cpan and its related programs all (I believe) have options to automatically install dependencies which you do not already have installed. I wonder if deleting you cpan config file and reconfiguring to make sure that that option is set would help.
If the log of the run does not show it, make sure to add the output of perl -V to the gist. Perl version info helps in these situations.

Error while Installing Math::Pari

I'm trying to install Math::Pari module but getting error.
I'm installing on Windows Server 2012R2, I've Strawberry perl v5.18.4.1 32-bit currently installed on it.
Actually Math::Pari is dependency for Net::SSH::W32Perl and I want to install that module.
Following is the error log. Please Give me step by step installation procedure.
cpanm (App::cpanminus) 1.7039 on perl 5.018004 built for MSWin32-x64-multi-thread
Work directory is C:\Users\script/.cpanm/work/1438929213.2276
You have make C:\strawberry\c\bin\dmake.exe
You have LWP 6.08
Falling back to Archive::Tar 2.02
Searching Math::Pari () on cpanmetadb ...
--> Working on Math::Pari
Fetching http://www.cpan.org/authors/id/I/IL/ILYAZ/modules/Math-Pari-2.010808.zip
-> OK
Unpacking Math-Pari-2.010808.zip
Entering Math-Pari-2.010808/
Checking configure dependencies from META.json
Checking if you have ExtUtils::MakeMaker 6.58 ... Yes (6.98)
Configuring Math-Pari-2.010808
Running Makefile.PL
Did not find GP/PARI build directory around.
Apparently, you are running a 64-bit Perl built with MicroSoft's compilers.
GP/PARI (at least the versions I know how to work with, 2.1.* and 2.3.*)
cannot be built in this environment. I won't auto-download GP/PARI.
If you believe that this message is printed erroneously, please report
(see files README and INSTALL), and put force_download on the command line:
perl Makefile.PL force_download
One can rerun Makefile.PL after fetching GP/PARI archive (e.g., pari-2.1.7.tgz,
or pari-2.3.4.tar.gz) manually to the current directory, or a (grand)parent
directory of the current directory.
[Keep in mind that the numbers "inside version" of Math::Pari module
correspond to the last versions of GP/PARI it was tested with (additionally,
2.0108* works best with the last 2.1.* version, 2.1.7).
As an alternative to having archive in CWD or its (grand)parent, specify
pari_tgz=PATH_TO_TAR_GZ
option to Makefile.PL.
There is no need to extract the archive, or build GP/PARI; but if you
have it extracted [and patched, if needed], you may specify
paridir=PATH_TO_DIST_DIR
option to Makefile.PL instead of `pari_tgz'. However, in this case
the files WON'T be auto-patched.
As a last-resort solution, there is also a possibility to use an already
compiled PARI library. See the documentation in README and INSTALL files.]
Could not find GP/PARI build directory, please run Makefile.PL
with paridir=/directory option.
-> N/A
-> FAIL Configure failed for Math-Pari-2.010808. See C:\Users\script\.cpanm\work\1438929213.2276\build.log for details.
I thought I'd add a note for anyone coming here as a result of a Google search after their own Math::Pari install fails under Strawberry Perl.
Here is what worked for me (Strawberry 5.22):
A. from the cpan shell, tried to install Math::Pari. this failed
B. Downloaded pari-2.1.7 and placed the extracted folder pari-2.1.7 in the cpan build folder that was created in (0). This is found, by default, in C:\Strawberry\cpan\build
C.perl Makefile.PL Configure machine=none
D. dmake
E. dmake install
It basically means that 64 bit versions of perl are not supported. It also means that if you're sure that you're running a 32 bit version incorrectly detected as 64 bit, you can try opening a command line and then doing
cd C:\Users\script\.cpanm\work\1438929213.2276\
perl Makefile.PL force_download