Unable to install Math::Pari module - perl

I am trying to install Crypt::Random module, a cryptographically secure random number generator, and says it requires Math::Pari 2.001802, which is not availible from cpan.org, but says it is available from this other URL, which does not work. I tried to install them both anyway and encountered this problem:
C:\Users\Jlinne\Documents> cpanm Crypt::Random
--> Working on Crypt::Random
Fetching http://www.cpan.org/authors/id/V/VI/VIPUL/Crypt-Random-1.25.tar.gz ... OK
Configuring Crypt-Random-1.25 ... OK
==> Found dependencies: Math::Pari
--> Working on Math::Pari
Fetching http://www.cpan.org/authors/id/I/IL/ILYAZ/modules/Math-Pari-2.01080900.zip ... OK
Configuring Math-Pari-2.01080900 ... N/A
! Configure failed for Math-Pari-2.01080900. See C:\Users\Jlinne\.cpanm\work\1476250290.12460\build.log for details.
! Installing the dependencies failed: Module 'Math::Pari' is not installed
! Bailing out the installation for Crypt-Random-1.25.
C:\Users\Jlinne\Documents> cpanm Math::Pari
--> Working on Math::Pari
Fetching http://www.cpan.org/authors/id/I/IL/ILYAZ/modules/Math-Pari-2.01080900.zip ... OK
Configuring Math-Pari-2.01080900 ... N/A
! Configure failed for Math-Pari-2.01080900. See C:\Users\Jlinne\.cpanm\work\1476250325.1340\build.log for details.
The build.log does not help me either, any other possible ways to install this module successfully? Thanks.

You will have to share the build.log file. Without that we cannot check what caused the failure.
BTW for Math::Pari you need PARI library. Starting from version 2.0, this module comes without a PARI library included.
Since you are trying to install Math-Pari-2.01080900, therefore you will first have to install PARI library.
Get it from http://pari.math.u-bordeaux.fr/download.html

If you're ok with using 32 bit Perl, you could use 32 bit Strawberry Perl, which already has both Math::Pari and Crypt::Random modules installed.
Unfortunately the 64 bit versions of Strawberry Perl do not include either of these modules. In that case, you'll have to follow the suggestion from Chankey Pathak about installing the PARI library in order to install the Math::Pari module.

Related

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.

Installing a patch for a dependent module: cpanm still tries to install broken module after I have installed patched module manually

I am trying to install Net::SSH::Perl using cpanm (from perlbrew and perl version 5.30). The installation fails with:
$ cpanm Net::SSH::Perl
--> Working on Net::SSH::Perl
Fetching http://www.cpan.org/authors/id/S/SC/SCHWIGON/Net-SSH-Perl-2.14.tar.gz ... OK
Configuring Net-SSH-Perl-2.14 ... OK
==> Found dependencies: Crypt::Curve25519
--> Working on Crypt::Curve25519
Fetching http://www.cpan.org/authors/id/A/AJ/AJGB/Crypt-Curve25519-0.06.tar.gz ... OK
Configuring Crypt-Curve25519-0.06 ... OK
Building and testing Crypt-Curve25519-0.06 ... FAIL
! Installing Crypt::Curve25519 failed. See /home/hakon/.cpanm/work/1587758019.381709/build.log for details. Retry with --force to force install it.
! Installing the dependencies failed: Missing version info for module 'Crypt::Curve25519'
! Bailing out the installation for Net-SSH-Perl-2.14.
The problem with installing Crypt::Curve25519 is described in this issue. I downloaded the problematic module Crypt::Curve25519 and patched it:
git clone git#github.com:ajgb/crypt-curve25519.git
wget https://www.cpan.org/authors/id/S/SR/SREZIC/patches/Crypt-Curve25519-0.06-PR10-ANOTHERLINK.patch
cd crypt-curve25519
git apply ../Crypt-Curve25519-0.06-PR10-ANOTHERLINK.patch
perl Makefile.PL
make # No errors now
make test
make install
However, when I try again to install Crypt::Curve25519 it still tries to install the broken module from CPAN:
$ cpanm Net::SSH::Perl
--> Working on Net::SSH::Perl
Fetching http://www.cpan.org/authors/id/S/SC/SCHWIGON/Net-SSH-Perl-2.14.tar.gz ... OK
Configuring Net-SSH-Perl-2.14 ... OK
==> Found dependencies: Crypt::Curve25519
--> Working on Crypt::Curve25519
Fetching http://www.cpan.org/authors/id/A/AJ/AJGB/Crypt-Curve25519-0.06.tar.gz ... OK
Configuring Crypt-Curve25519-0.06 ... OK
Building and testing Crypt-Curve25519-0.06 ... FAIL
! Installing Crypt::Curve25519 failed. See /home/hakon/.cpanm/work/1587758833.382749/build.log for details. Retry with --force to force install it.
! Installing the dependencies failed: Missing version info for module 'Crypt::Curve25519'
! Bailing out the installation for Net-SSH-Perl-2.14.
How can I make cpanm use the installed patch instead (i.e. skip installation of Crypt::Curve25519 since it is already installed)?
The problem seems to be missing VERSION information in the module. By adding a line
our $VERSION = 0.06;
to the top of the file lib/Crypt/Curve25519.pm and then reinstall, and then installing cpanm Net::SSH::Perl worked fine (it accepted the patched installation and did not try to download the broken version).
Here is the patch I used to lib/Crypt/Curve25519.pm:
diff --git a/lib/Crypt/Curve25519.pm b/lib/Crypt/Curve25519.pm
index 686b706..d9c2b3d 100644
--- a/lib/Crypt/Curve25519.pm
+++ b/lib/Crypt/Curve25519.pm
## -1,4 +1,5 ##
package Crypt::Curve25519;
+our $VERSION = 0.06;
#ABSTRACT: Generate shared secret using elliptic-curve Diffie-Hellman function
use strict;
There's a few things to check:
cpanm knows where to find your patched version.
The patched version has a version that's higher than the one on CPAN. The module idea in CPAN assumes that you always want the latest, so ensure that yours is.
You don't want to install a patched module at the standard location because you don't want a cpan client to overwrite it.
Some other things that can work:
Force install the module and ignore the failures (cpanm has a --notest feature). The CPAN version is still installed, but that doesn't matter.
Have your patched version in a separate directory that's at the front of #INC so your program finds it first. This effectively hides the CPAN version.

How to fix Perl from anaconda not installing bioperl? `Bailing out the installation for BioPerl-1.007002.`

I am using conda to install several packages. I already installed Perl under conda and is the one working in this machine (running Ubuntu 18.04). Now I am trying to use a script that requires bioperl.
I tried to update conda, install bioperl through conda AND installing bioperl through cpanm as shown below.
I checked to currently used Perl is the anaconda one. The shebang in the perl script is #!/home/evo-slave/anaconda_ete/bin/perl -w
This is the initial error while running the script
Can't locate Bio/SeqIO.pm in #INC (you may need to install the
Bio::SeqIO module) (#INC contains: /home/evo-
slave/anaconda_ete/lib/site_perl/5.26.2/x86_64-linux-thread-multi
/home/evo-slave/anaconda_ete/lib/site_perl/5.26.2 /home/evo-
slave/anaconda_ete/lib/5.26.2/x86_64-linux-thread-multi /home/evo-
slave/anaconda_ete/lib/5.26.2 .) at ./cortador.pl line 9.
BEGIN failed--compilation aborted at ./cortador.pl line 9.
I don`t know if this is an issue of bioperl not being called/installed by the anaconda perl or during the execution of the script, maybe this lines within the script should indicate something else
use File::Basename;
use Bio::SeqIO;
use Bio::Seq;
use Bio::DB::SeqFeature::Store;
use Bio::SeqFeatureI;
When I try to install
cpanm Bio::Perl
I got this error
--> Working on Bio::Perl
Fetching http://www.cpan.org/authors/id/C/CJ/CJFIELDS/BioPerl-
1.007002.tar.gz ... OK
Configuring BioPerl-1.007002 ... OK
==> Found dependencies: IO::String, Data::Stag, Test::Most
--> Working on IO::String
Fetching http://www.cpan.org/authors/id/G/GA/GAAS/IO-String-
1.08.tar.gz ... OK
Configuring IO-String-1.08 ... OK
Building and testing IO-String-1.08 ... OK
Successfully installed IO-String-1.08
--> Working on Data::Stag
Fetching http://www.cpan.org/authors/id/C/CM/CMUNGALL/Data-Stag-
0.14.tar.gz ... OK
Configuring Data-Stag-0.14 ... OK
==> Found dependencies: IO::String
! Installing the dependencies failed: Module 'IO::String' is not
installed
! Bailing out the installation for Data-Stag-0.14.
--> Working on Test::Most
Fetching http://www.cpan.org/authors/id/O/OV/OVID/Test-Most-
0.35.tar.gz ... OK
Configuring Test-Most-0.35 ... OK
==> Found dependencies: Test::Warn, Test::Deep, Test::Differences,
Test::Exception, Exception::Class
--> Working on Test::Warn
Fetching http://www.cpan.org/authors/id/B/BI/BIGJ/Test-Warn-
0.36.tar.gz ... OK
Configuring Test-Warn-0.36 ... OK
==> Found dependencies: Sub::Uplevel
--> Working on Sub::Uplevel
Fetching http://www.cpan.org/authors/id/D/DA/DAGOLDEN/Sub-Uplevel-
0.2800.tar.gz ... OK
Configuring Sub-Uplevel-0.2800 ... OK
Building and testing Sub-Uplevel-0.2800 ... OK
Successfully installed Sub-Uplevel-0.2800
! Installing the dependencies failed: Module 'Sub::Uplevel' is not
installed
! Bailing out the installation for Test-Warn-0.36.
--> Working on Test::Deep
Fetching http://www.cpan.org/authors/id/R/RJ/RJBS/Test-Deep-
1.128.tar.gz ... OK
Configuring Test-Deep-1.128 ... OK
Building and testing Test-Deep-1.128 ... OK
Successfully installed Test-Deep-1.128
--> Working on Test::Differences
Fetching http://www.cpan.org/authors/id/D/DC/DCANTRELL/Test-
Differences-0.67.tar.gz ... OK
Configuring Test-Differences-0.67 ... OK
==> Found dependencies: Capture::Tiny, Text::Diff
--> Working on Capture::Tiny
Fetching http://www.cpan.org/authors/id/D/DA/DAGOLDEN/Capture-
Tiny-0.48.tar.gz ... OK
Configuring Capture-Tiny-0.48 ... OK
Building and testing Capture-Tiny-0.48 ... OK
Successfully installed Capture-Tiny-0.48
--> Working on Text::Diff
Fetching http://www.cpan.org/authors/id/N/NE/NEILB/Text-Diff-
1.45.tar.gz ... OK
Configuring Text-Diff-1.45 ... OK
==> Found dependencies: Algorithm::Diff
--> Working on Algorithm::Diff
Fetching http://www.cpan.org/authors/id/T/TY/TYEMQ/Algorithm-Diff-
1.1903.tar.gz ... OK
Configuring Algorithm-Diff-1.1903 ... OK
Building and testing Algorithm-Diff-1.1903 ... OK
Successfully installed Algorithm-Diff-1.1903
! Installing the dependencies failed: Module 'Algorithm::Diff' is
not installed
! Bailing out the installation for Text-Diff-1.45.
! Installing the dependencies failed: Module 'Text::Diff' is not
installed, Module 'Capture::Tiny' is not installed
! Bailing out the installation for Test-Differences-0.67.
--> Working on Test::Exception
Fetching http://www.cpan.org/authors/id/E/EX/EXODIST/Test-
Exception-0.43.tar.gz ... OK
Configuring Test-Exception-0.43 ... OK
==> Found dependencies: Sub::Uplevel
! Installing the dependencies failed: Module 'Sub::Uplevel' is not
installed
! Bailing out the installation for Test-Exception-0.43.
--> Working on Exception::Class
Fetching http://www.cpan.org/authors/id/D/DR/DROLSKY/Exception-
Class-1.44.tar.gz ... OK
Configuring Exception-Class-1.44 ... OK
==> Found dependencies: Class::Data::Inheritable
--> Working on Class::Data::Inheritable
Fetching http://www.cpan.org/authors/id/T/TM/TMTM/Class-Data-
Inheritable-0.08.tar.gz ... OK
Configuring Class-Data-Inheritable-0.08 ... OK
Building and testing Class-Data-Inheritable-0.08 ... OK
Successfully installed Class-Data-Inheritable-0.08
! Installing the dependencies failed: Module
'Class::Data::Inheritable' is not installed
! Bailing out the installation for Exception-Class-1.44.
! Installing the dependencies failed: Module 'Test::Exception' is
not installed, Module 'Test::Differences' is not installed, Module
'Exception::Class' is not installed, Module 'Test::Warn' is not
installed, Module 'Test::Deep' is not installed
! Bailing out the installation for Test-Most-0.35.
! Installing the dependencies failed: Module 'Test::Most' is not
installed, Module 'IO::String' is not installed, Module
'Data::Stag'
is not installed
! Bailing out the installation for BioPerl-1.007002.
6 distributions installed
ETA: It seems something is wrong and the dependencies of the modules that are required are not installed during a simple cpanm
Example of a round trying to install everything that is needed
cpanm Sub::Uplevel
--> Working on Sub::Uplevel
Fetching http://www.cpan.org/authors/id/D/DA/DAGOLDEN/Sub-Uplevel-0.2800.tar.gz ... OK
Configuring Sub-Uplevel-0.2800 ... OK
Building and testing Sub-Uplevel-0.2800 ... OK
Successfully installed Sub-Uplevel-0.2800
1 distribution installed
then
cpanm Test::Warn
--> Working on Test::Warn
Fetching http://www.cpan.org/authors/id/B/BI/BIGJ/Test-Warn-0.36.tar.gz ... OK
Configuring Test-Warn-0.36 ... OK
==> Found dependencies: Sub::Uplevel
--> Working on Sub::Uplevel
Fetching http://www.cpan.org/authors/id/D/DA/DAGOLDEN/Sub-Uplevel-0.2800.tar.gz ... OK
Configuring Sub-Uplevel-0.2800 ... OK
Building and testing Sub-Uplevel-0.2800 ... OK
Successfully installed Sub-Uplevel-0.2800
! Installing the dependencies failed: Module 'Sub::Uplevel' is not installed
! Bailing out the installation for Test-Warn-0.36.
1 distribution installed
Some info to help debugging:
$ set | grep ^PERL
PERL5LIB=:/media/evo-slave/Disco2/ANDRES/DOWNLOADS/GENOME/CAV-POC/GAAS/annotation
PERL_MB_OPT='--install_base "/home/evo-slave/perl5"'
PERL_MM_OPT=INSTALL_BASE=/home/evo-slave/perl5
$ which cpanm
/home/evo-slave/anaconda_ete/bin/cpanm
$ head -n 1 "$( which cpanm )"
#!/home/evo-slave/anaconda_ete/bin/perl
UPDATE 2
This problem is coming up again in miniconda3 bioperl installs.
UPDATE
I have not experienced this error for a while with perl packages, so likely some updates occurred on the conda/package side that fixed this. I would recommend trying to update your conda and checking your conda channels before trying this kind of weird kludge.
ORIGINAL ANSWER
I am posting this as an answer not because it's a good idea, but because it provides more information. I am working on Amazon Linux so it's slightly different, but also running into issues with bioperl dependencies installed through conda. In my case I am trying to run VirSorter, which mentions this problem and proposes a solution that does not work for me, but suggests confirming that your PERL5LIB is properly set.
I observed that my perl is 5.26.2:
$ perl --version
This is perl 5, version 26, subversion 2 (v5.26.2) built for x86_64-linux-thread-multi
But conda is for some obscure reason installing my perl dependencies for 5.22.0: /home/ec2-user/anaconda3/envs/virsorter/lib/perl5/site_perl/5.22.0/:
$ ls /home/ec2-user/anaconda3/envs/virsorter/lib/perl5/site_perl/5.22.0/
Algorithm Bio Capture Class Data Devel Exception IO Sub Test Text URI URI.pm x86_64-linux-thread-multi
I found that I could get VirSorter running, apparently successfully, by simply setting PERL5LIB to the 5.22.0 lib under conda:
OLD_PER5LIB=$PERL5LIB
export PERL5LIB=/home/ec2-user/anaconda3/envs/virsorter/lib/perl5/site_perl/5.22.0/
# run virsorter
# no errors!
I am sure that this throws up a bunch of red flags for the perl people, and I'm sure that it's very fragile if it actually works at all. Perhaps the question is why conda is installing perl modules as the wrong perl version?

What to do for Math::Pari in cpan terminal

I found this one relevant question on problems with installing Math::Pari, here. Except this is for shell and I have cpanm. I downloaded the latest version of Pari, Pari 2-7-6. Where should I extract the files in C:\Program Files (x86)\Pari-2-7-6 to install Math::Pari in perl (not in cpan shell however) successfully? Thanks in advance.
C:\Users\Jlinne\Documents> cpanm Math::Pari
--> Working on Math::Pari
Fetching http://www.cpan.org/authors/id/I/IL/ILYAZ/modules/Math-Pari-2.01080900.zip ... OK
Configuring Math-Pari-2.01080900 ... N/A
! Configure failed for Math-Pari-2.01080900. See C:\Users\Jlinne\.cpanm\work\1476648581.10216\build.log for details.
Here is an easy way on Windows:
Download and extract the module: https://metacpan.org/pod/Math::Pari
cd into the directory you created when extracting
perl Makefile.PL force_download <- this downloads things to the right place
dmake
dmake install

Modules install successfully but cannot be found

I am wondering why I get "Installing the dependencies failed: Module 'Module::Name' is not installed" even when dependency is has been installed. I am using perlbrew and cpanm. Here is an example of what happens with many modules that I try to install:
I try to install for example URI::ws as follow
hamid#caspian:~$ /home/hamid/perl5/perlbrew/bin/cpanm --installdeps URI::ws
--> Working on URI::ws
Fetching http://www.cpan.org/authors/id/P/PL/PLICEASE/URI-ws-0.03.tar.gz ... OK
Configuring URI-ws-0.03 ... OK
==> Found dependencies: URI
--> Working on URI
Fetching http://www.cpan.org/authors/id/E/ET/ETHER/URI-1.67.tar.gz ... OK
Configuring URI-1.67 ... OK
Building and testing URI-1.67 ... OK
Successfully installed URI-1.67
! Installing the dependencies failed: Module 'URI' is not installed
! Bailing out the installation for URI-ws-0.03.
1 distribution installed
it tells me URI is not installed. So I install URI as follow:
hamid#caspian:~$ /home/hamid/perl5/perlbrew/bin/cpanm URI
--> Working on URI
Fetching http://www.cpan.org/authors/id/E/ET/ETHER/URI-1.67.tar.gz ... OK
Configuring URI-1.67 ... OK
Building and testing URI-1.67 ... OK
Successfully installed URI-1.67
1 distribution installed
I go back to what I originally wanted which was URI::ws and here is what I get:
hamid#caspian:~$ /home/hamid/perl5/perlbrew/bin/cpanm URI::ws
--> Working on URI::ws
Fetching http://www.cpan.org/authors/id/P/PL/PLICEASE/URI-ws-0.03.tar.gz ... OK
Configuring URI-ws-0.03 ... OK
==> Found dependencies: URI
--> Working on URI
Fetching http://www.cpan.org/authors/id/E/ET/ETHER/URI-1.67.tar.gz ... OK
Configuring URI-1.67 ... OK
Building and testing URI-1.67 ... OK
Successfully installed URI-1.67
! Installing the dependencies failed: Module 'URI' is not installed
! Bailing out the installation for URI-ws-0.03.
1 distribution installed
Can anyone tell me why this is happening and what I can do to stop it? If there is any more information that you need which I have missed please let me know.
Thank you
Thanks to https://stackoverflow.com/users/2019415/g-cito
hamid#caspian:~$ PERL_MM_OPT=""; PERL_MB_OPT="";
has done the job :)
local::lib was messing stuff up. URI.pm was installed but not under the perlbrew directory.
With perlbrew you can install a perlbrew specific cpanm which facilitates installing to the various perls/ that are installed/managed using the perlbrew tool. I have found that this works very well.
However perlbrew can become confused if you mix in your own local::lib and set related environment variables like PERL5LIB, PERL_MM_OPT, PERL_MB_OPT etc. (see for example the post by #cjm in perlbrew and local::lib at the same time?). Some of these environment vars can interact and interfere with perlbrew's own environment so it's generally best to avoid mixing them or simply to let perlbrew manage the environment using its own versions of those variables.
It is of course possible to use local::lib environments "inside" perlbrew with the lib command) and to do very complicated things for testing with different perl versions, shipping an application with requirements (c.f. Carton). In my own environment I was able to manage system perl; a user installed local::lib that used the system perl; and a huge set of perlbrew perls all with judicious use of environment variables (thankfully a temporary set up while migrating between versions).
That sort of set up can get complicated very quickly, and is difficult to replicate. One of the greatest advantages of perlbrew is you can easily setup matching perl environments on multiple machines; or different perl environments on the same machine.