I installed and used the program module-tools on several machines, but this time i can't get it to work (CentOS 7). One Problem is, that i have to call my programs with "perl test.pl" instead of just "test.pl".
The bigger problem is, that the program doesn't run, it stops with an error.
https://github.com/OTRS/module-tools
[root#localhost bin]# sudo -u otrs perl otrs.ModuleTools.pl Module::File::Link
Could not require Console::Command::List:
Attempt to reload Console/BaseCommand.pm aborted.
Compilation failed in require at /usr/share/perl5/vendor_perl/parent.pm line 20.
BEGIN failed--compilation aborted at /opt/module-tools/lib/Console/Command/List.pm line 16.
Compilation failed in require at /opt/module-tools/lib/System.pm line 60.
Anybody any ideas?
Edit: I installed the dependencies with cpanm.
It also looks like the program runs further as root. It should not run as root, so it closes with an error for that, but it loads the file it can't run as the other user
Edit2:
When i run "perl -V" it get a difference at the end.
Root:
Built under linux
Compiled at Jan 21 2019 22:09:19
%ENV:
PERL5LIB="/root/perl5/lib/perl5"
PERL_LOCAL_LIB_ROOT="/root/perl5"
PERL_MB_OPT="--install_base "/root/perl5""
PERL_MM_OPT="INSTALL_BASE=/root/perl5"
#INC:
/root/perl5/lib/perl5/5.16.3/x86_64-linux-thread-multi
/root/perl5/lib/perl5/5.16.3
/root/perl5/lib/perl5/x86_64-linux-thread-multi
/root/perl5/lib/perl5
/usr/local/lib64/perl5
/usr/local/share/perl5
/usr/lib64/perl5/vendor_perl
/usr/share/perl5/vendor_perl
/usr/lib64/perl5
/usr/share/perl5
Other User:
Built under linux
Compiled at Jan 21 2019 22:09:19
#INC:
/usr/local/lib64/perl5
/usr/local/share/perl5
/usr/lib64/perl5/vendor_perl
/usr/share/perl5/vendor_perl
/usr/lib64/perl5
/usr/share/perl5
.
Could this have something to do with that? Everything else from the output is identical.
RESOLVED!:
I installed the whole vm again, and this time i installed cpanm with
sudo yum install "perl(App::cpanminus)"
I don't remember how i did that before, but the last time i had to give cpanm a few settings and choose at one point "local::lib" instead of "sudo". I gues i should have chosen "sudo". But it wirks now, thanks
Install dependencies from cpanfile. If you have cpanm on your server, you can do it this way:
cd ./module-tools
cpanm -l ./deps --installdeps .
perl -I ./deps/lib/perl5/ ./bin/otrs.ModuleTools.pl
We can force cpanm to install all dependencies into chooses directory with -l flag, and than, we show to interpreter where is all dependencies with -I ./deps/lib/perl5/
Related
I'm trying to run unitas_1.7.8.pl, a bioinformatic software available here. Importantly, I've used this software many times in the past successfully on this ubuntu machine. Now when I run the command
perl ~/scripts/unitas_1.7.0.pl -threads 24 -s homo_sapiens -i PCR_Primer_11_S11_L001_R1_001.trim.lng ...
I get the error
Perl module LWP::Simple is not installed on this machine!
Perl module Archive::Extract (in core since 2007-07-07) is not installed on this machine!
Perl modules are available for download at http://www.cpan.org/
If you have CPAN installed try the following:
cpan
install Archive::Extract
exit
If you are on MAC or UNIX you should run cpan with sudo:
sudo cpan
install Archive::Extract
exit
I've followed those instructions and updated AND reinstalled cpan (even though I know it should be fine) without apparent issues. The only thing I can think of that has changed since the last time I successfully used unitas is that the server was hard-rebooted a month ago.
Details:
Distributor ID: Ubuntu
Description: Ubuntu 20.04.2 LTS
Release: 20.04
Codename: focal
$ cpan --version
Loading internal logger. Log::Log4perl recommended for better logging
/home/user/miniconda3/bin/cpan version 1.64 calling Getopt::Std::getopts (version 1.12 [paranoid]),
running under Perl version 5.30.3.
[Now continuing due to backward compatibility and excessive paranoia.
See 'perldoc Getopt::Std' about $Getopt::Std::STANDARD_HELP_VERSION.]
Nothing to install!
$ type -p perl; perl -M5.010 -e'say "$_: $ENV{$_}" for sort grep /^PERL/, keys(%ENV)'; echo 'o conf' | cpan
/home/stewart/miniconda3/bin/perl
[...]
make [/usr/bin/make]
make_arg []
make_install_arg []
make_install_make_command [/usr/bin/make]
makepl_arg [INSTALLDIRS=site]
mbuild_arg []
mbuild_install_arg []
mbuild_install_build_command [./Build]
mbuildpl_arg [--installdirs site]
[...]
$ perl -MLWP::Simple -E 'say $INC{"LWP/Simple.pm"}'
Can't locate LWP/Simple.pm in #INC (you may need to install the LWP::Simple module) (#INC contains: /home/stewart/miniconda3/lib/site_perl/5.30.3/x86_64-linux-thread-multi /home/stewart/miniconda3/lib/site_perl/5.30.3 /home/stewart/miniconda3/lib/5.30.3/x86_64-linux-thread-multi /home/stewart/miniconda3/lib/5.30.3 .).
BEGIN failed--compilation aborted.
$ head -n 1 "$( type -p cpan )"
#!/home/stewart/miniconda3/bin/perl
$ perl -MLWP::Simple -e'print "ok\n"'
Can't locate LWP/Simple.pm in #INC (you may need to install the LWP::Simple module) (#INC contains: /home/stewart/miniconda3/lib/site_perl/5.30.3/x86_64-linux-thread-multi /home/stewart/miniconda3/lib/site_perl/5.30.3 /home/stewart/miniconda3/lib/5.30.3/x86_64-linux-thread-multi /home/stewart/miniconda3/lib/5.30.3 .).
BEGIN failed--compilation aborted.
current state of LWP::Simple and Archive::Extract
$ sudo cpan install LWP::Simple
Loading internal logger. Log::Log4perl recommended for better logging
Reading '/root/.cpan/Metadata'
Database was generated on Tue, 07 Sep 2021 08:55:47 GMT
LWP::Simple is up to date (6.56).
$ sudo cpan install Archive::Extract
Loading internal logger. Log::Log4perl recommended for better logging
Reading '/root/.cpan/Metadata'
Database was generated on Tue, 07 Sep 2021 08:55:47 GMT
Archive::Extract is up to date (0.88).
$ sudo cpan LWP::Simple
Loading internal logger. Log::Log4perl recommended for better logging
Reading '/root/.cpan/Metadata'
Database was generated on Tue, 07 Sep 2021 08:55:47 GMT
LWP::Simple is up to date (6.56).
If you already have Miniconda, then you should install using the Bioconda channel in an isolated environment. Your Perl installation, from conda, is interfering with your system CPAN modules:
conda create -n unitas -c bioconda unitas
conda activate unitas
unitas.pl -threads 24 -s homo_sapiens -i PCR_Primer_11_S11_L001_R1_001.trim.lng ...
conda deactivate
None of the solutions suggested worked for me except calling perl directly from another directory (which already had it installed).
/usr/bin/perl5.30.0 ~/scripts/unitas_1.7.0.pl ...
There may be a way to switch the default perl used when called to this directory with $PATH, but I found this workaround for now. Thanks all for your help.
I am new to Perl so please bear with me. Thank you for your assistance.
I have an Ubuntu machine with Perl on it. I followed the local::lib bootstrapping guide
I used cpanm to install DBI and other modules to my system. I am concerned there may be other DBI modules available on my system which could be part of the problem. This is the result of find / -name 'DBI.pm' 2>/dev/null:
/home/ubuntu/.cpanm/work/16125643.6178/DBI-1.643/blib/lib/DBI.pm
/home/ubuntu/.cpanm/work/16125643.6178/DBI-1.643/blib/lib/Bundle/DBI.pm
/home/ubuntu/.cpanm/work/16125643.6178/DBI-1.643/DBI.pm
/home/ubuntu/.cpanm/work/16125643.6178/DBI-1.643/lib/Bundle/DBI.pm
/home/ubuntu/perl5/lib/perl5/x86_64-linux-gnu-thread-multi/DBI.pm
/home/ubuntu/perl5/lib/perl5/x86_64-linux-gnu-thread-multi/Bundle/DBI.pm
I added 2 lines to my .bashrc file. (I added the second line because I broke things for the non-root user and this fixed it; maybe I broke something with local::lib?)
eval "$(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib)"
PERL5LIB="/home/ubuntu/perl5/lib/perl5"
I can run my perl script as a non-root user.
If I run with sudo perlScript.pl I get this error: Can't locate DBI.pm in #INC (you may need to install the DBI module)
I have been troubleshooting #INC for a while now and cannot figure out how to adjust it for the root user. I have tried various things including adding PERL5LIB to .profile and calling my script like so: sudo sh -c '. ~/.profile; perl ~/perlScripts/perlScript.pl "argForScript"' (I verified that PERL5LIB is being set with sudo sh -c '. ~/.profile; echo $PERL5LIB')
However I always get the #INC error. The most obvious thing I have noticed is comparing sudo perl -V and perl -V. The sudo call does not show any ENV vars and the #INC does not include the desired PERL5LIB location. The non-sudo call does show the desired ENV and #INC vars.
I am considering wiping things and doing a fresh install with root privileges for local::lib and cpan. Not really sure what else to try at this point.
These are the commands that ended up working for me. I corrupted my first environment with local::lib / non-sudo cpan install, so I setup a fresh VM.
sudo apt install make
sudo apt install build-essential
sudo apt install libmysqlclient-dev
sudo cpan App::cpanminus
cpanm --sudo DBI
cpanm --sudo Array::Utils
cpanm --sudo DBD::mysql
Hi I am trying to install VelvetOptimizer using docker. and it say Can't locate Bio/SeqIO.pm in #INC. It requires the following to be installed:
Velvet >= 0.7.51 ,Perl >= 5.8, BioPerl >= 1.4 and i have installed them
Please find the Dockerfile:
FROM amazonlinux
WORKDIR /shared
RUN yum -y install gcc
ADD http://www.cpan.org/src/5.0/perl-5.16.1.tar.gz /shared
RUN tar -xzf perl-5.16.1.tar.gz
WORKDIR /shared/perl-5.16.1
RUN ./Configure -des -Dprefix=/shared/perl-5.16.1/localperl
RUN make
RUN make test
RUN make install
RUN echo “Perl Installation Complete”
ENV PATH=/shared/perl-5.16.1/localperl/bin/:${PATH}
WORKDIR /shared
ADD http://www.ebi.ac.uk/~zerbino/velvet/velvet_latest.tgz .
RUN tar -xvf /shared/velvet_latest.tgz
WORKDIR /shared/velvet_1.2.10/
RUN make
ENV PATH=${PATH}:/shared/velvet_1.2.10/
WORKDIR /shared
RUN echo "BIO PERL INSTALLATION"
RUN \wget -O - https://install.perlbrew.pl | bash
ENV PATH=${PATH}:/root/perl5/perlbrew/bin/
RUN perlbrew install-cpanm
RUN cpanm Bio::Perl
WORKDIR /shared
ADD http://www.vicbioinformatics.com/VelvetOptimiser-2.2.5.tar.gz .
RUN tar zxvf VelvetOptimiser-2.2.5.tar.gz
ENV PATH=${PATH}:/shared/VelvetOptimiser-2.2.4
When I run the command/shared/VelvetOptimiser-2.2.5/VelvetOptimiser.pl
I get the below error:
Error:
Can't locate Bio/SeqIO.pm in #INC (#INC contains: /shared/VelvetOptimiser-2.2.5 /shared/vcftools/src/perl /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /shared/VelvetOptimiser-2.2.5/VelvetOpt/Assembly.pm line 238.
BEGIN failed--compilation aborted at /shared/VelvetOptimiser-2.2.5/VelvetOpt/Assembly.pm line 238.
Compilation failed in require at /shared/VelvetOptimiser-2.2.5/VelvetOptimiser.pl line 37.
BEGIN failed--compilation aborted at /shared/VelvetOptimiser-2.2.5/VelvetOptimiser.pl line 37.
But when I use "find" command: I am able to find the files.
./root/.cpanm/work/1501770319.1/BioPerl-1.007001/blib/lib/Bio/SeqIO.pm
./root/.cpanm/work/1501770319.1/BioPerl-1.007001/Bio/SeqIO.pm
./shared/perl-5.16.1/localperl/lib/site_perl/5.16.1/Bio/SeqIO.pm
I think its not be found in Perl's include path, which is represented by the variable named #INC.
Can anyone please let me know how to fix this issue. how to add it in perls include path.
Clearly, /shared/VelvetOptimiser-2.2.5/VelvetOptimiser.pl has
#!/usr/bin/env perl
as its shebang line. So, it will use the first perl it finds in the $PATH.
You likely have a perl in /usr/bin. In your Docker file, you have:
ENV PATH=${PATH}:/root/perl5/perlbrew/bin/
That is, you likely put /usr/bin ahead of the perlbrew directory. So, /usr/bin/env perl is picking up /usr/bin/perl and not the perl you installed via perlbrew (which is also where you installed your new perl).
So, try
ENV PATH=/root/perl5/perlbrew/bin/:${PATH}
In addition, I do not see you actually install a perl via perlbrew:
You need
perlbrew install 5.xx.x
perlbrew switch 5.xx.x
before installing cpanm and installing Bio::Perl.
I'm trying to install Perl modules Geo::ShapeFile and Math::Round but I keep coming across the same error and I can't find a solution that works. I've local::lib installed fine but its not being found or something? Am I doing it in the wrong place?
cian#cian-Aspire-5750:~/Documents/Math-Round-0.07$ make install
Manifying 1 pod document
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
ERROR: Can't create '/usr/local/man/man3'
mkdir /usr/local/man/man3: Permission denied at /usr/share/perl/5.22/ExtUtils/Install.pm line 477.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
at -e line 1.
Makefile:697: recipe for target 'pure_site_install' failed
make: *** [pure_site_install] Error 13
I notice in my directory '/usr/local/man' points to 'usr/share/man'. I dunno if this was an issue how to solve it. Thanks.
I've local::lib installed fine
No, you don't. The environment has clearly not by set by local::lib. Make sure the following in your login script:
eval "$(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib)"
(Adjust the path to local::lib if needed.)
Log out and log back in or use the following to pick up the changes:
exec bash -l
If you want to install module systemwide (it's what you do), you should have root privileges. Try sudo make install or install modules locally.
Alternatively you may try a cpanm client, which handles local::lib installs either:
$ cpanm -l ~/ Geo::ShapeFile Math::Round
And then don't forget to adjust perl5lib var to see installed modules:
$ PERL5LIB=~/lib/perl5
I installed a perl module by force install and now perl does not work any longer. Somehow this must have set permissions wrong.
perl -V
Can't locate Config.pm: Permission denied.
BEGIN failed--compilation aborted.
How can I fix this? I am on a Mac. I would also do a reinstall or recover stuff from a backup if I only know how or what files.
Perl: How to fix: "perl -V": Can't locate Config.pm: Permission denied
Find out what the compiled-in #INC is:
sudo perl -V
#INC:
/etc/perl
/usr/local/lib/perl/5.18.2
/usr/local/share/perl/5.18.2
/usr/lib/perl5
/usr/share/perl5
/usr/lib/perl/5.18
/usr/share/perl/5.18
/usr/local/lib/site_perl"
For each path and all of it's parents make sure that the permissions include "rx", e.g. for "/usr/local/share/perl/5.18.2":
sudo chmod ugo+rx /usr
sudo chmod ugo+rx /usr/local
sudo chmod ugo+rx /usr/local/share
sudo chmod ugo+rx /usr/local/share/perl
sudo chmod ugo+rx /usr/local/share/perl/5.18.2
I reinstalled. Yes, I did and now this answer is long enough.
check the $PERL5LIB, echo $PERL5LIB, check if any paths in the $PERL5LIB is permission denied.
eg. in my computer.
$PERL5LIB
/root/perl5:/home/t7910/usr/perl5:/home/t7910/perl5/lib/perl5
so, /root/perl5: is permission denied.