Perl script Can't locate Text/Template.pm in #INC [duplicate] - mysql

This question already has answers here:
Why does my Perl program complain "Can't locate URI.pm in #INC"?
(5 answers)
Closed 7 years ago.
I am trying to tune the MySQL tuner script written in Perl. But getting the error below:
root#server2 [/tmp]# perl mysqltuner.pl
Can't locate Text/Template.pm in #INC (#INC contains: /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 mysqltuner.pl line 2816.
BEGIN failed--compilation aborted at mysqltuner.pl line 2816 (#1)
(F) You said to do (or require, or use) a file that couldn't be
found. Perl looks for the file in all the locations mentioned in #INC,
unless the file name included the full path to the file. Perhaps you
need to set the PERL5LIB or PERL5OPT environment variable to say where
the extra library is, or maybe the script needs to add the library name
to #INC. Or maybe you just misspelled the name of the file. See
perlfunc/require and lib.
Uncaught exception from user code:
Can't locate Text/Template.pm in #INC (#INC contains: /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 mysqltuner.pl line 2816.
BEGIN failed--compilation aborted at mysqltuner.pl line 2816.
at mysqltuner.pl line 2816
It would glad to provide solution for the same.

In your perl script mysqltuner.pl, you are using a module Text::Template which is not installed in your system, that's why you are getting this warning.
You can installed it by using cpan. If you are on Linux system, open a terminal and type:
sudo cpan install Text::Template #sudo is not required if you have login as root.
If you are on windows system and using ActivePerl, use this:
ppm install Text-Template

Open Command Promt. Type in the following:
ppm install Text-Template

Related

unable to install any pkg in Octave

I am new to Octave, coming from Matlab. I am trying to install a few packages, and so far none has worked. I have tried the download method from forge, then running the install command. But my question is about my latest attempt. There it is:
pkg install -global -forge io
csvconcat.cc:79:37: warning: result of comparison of constant 18446744073709551615 with expression of type
'unsigned int' is always true [-Wtautological-constant-out-of-range-compare]
while ((pos=str.find(prot, pos)) != str.npos) {
~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~
1 warning generated.
error: couldn't append to /Applications/Octave-4.4.1.app/Contents/Resources/usr/Cellar/octave-octave-app#4.4.1/4.4.1/share/octave/octave_packages
save: unable to open output file '/Applications/Octave-4.4.1.app/Contents/Resources/usr/Cellar/octave-octave-app#4.4.1/4.4.1/share/octave/octave_packages'
error: called from
install at line 254 column 7
pkg at line 437 column 9
Couldn't find any documentation on it, I am a bit lost.... (oh and btw, I can't find the config.log file! where is that gem?)
I am on MacOS catalina 10.15.7, and just followed that procedure https://flaviocopes.com/fix-xcrun-error-invalid-active-developer-path/, which solved the issues I had before which is described on that page.
cheers for any help
The error:
error: couldn't append to /Applications/Octave-4.4.1.app/Contents/Resources/usr/Cellar/octave-octave-app#4.4.1/4.4.1/share/octave/octave_packages
save: unable to open output file '/Applications/Octave-4.4.1.app/Contents/Resources/usr/Cellar/octave-octave-app#4.4.1/4.4.1/share/octave/octave_packages'
error: called from
install at line 254 column 7
pkg at line 437 column 9
basically says it's failing to save to that file. Probably a permissions issue. Check if the file /Applications/Octave-4.4.1.app/Contents/Resources/usr/Cellar/octave-octave-app#4.4.1/4.4.1/share/octave/octave_packages exists and its permissions. That file is a database of all packages installed globally, i.e., for all users in the system.
Fixing the permission issues is dependent on what is the permissions issue you have (probably you need to run octave as root to install a global package). But maybe try to install the package for your user only, i.e., install the package without the -global flag, like so:
pkg install -forge io

Cannot find DBI.pm even if it's in the path

I'm trying to install the munin-mysql plugin but I'm facing a strange error. Munin complains that it cannot find DBI.pm in the #INC:
[root#mybox perl5]# munin-run mysql
Can't locate DBI.pm in #INC (#INC contains: /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 /etc/munin/plugins/mysql line 127.
BEGIN failed--compilation aborted at /etc/munin/plugins/mysql line 127.
However, it is indeed in the path, and precisely at /usr/local/lib64/perl5. It was installed via the command cpanm DBI.
In fact, there are several DBI.pm files; how do I know which one is to be used?
[root#mybox perl5]# find / -name DBI.pm
/root/.cpan/build/DBI-1.634-Aazmvi/blib/lib/Bundle/DBI.pm
/root/.cpan/build/DBI-1.634-Aazmvi/blib/lib/DBI.pm
/root/.cpan/build/DBI-1.634-Aazmvi/lib/Bundle/DBI.pm
/root/.cpan/build/DBI-1.634-Aazmvi/DBI.pm
/root/.cpanm/work/1460983027.32244/DBI-1.634/blib/lib/Bundle/DBI.pm
/root/.cpanm/work/1460983027.32244/DBI-1.634/blib/lib/DBI.pm
/root/.cpanm/work/1460983027.32244/DBI-1.634/lib/Bundle/DBI.pm
/root/.cpanm/work/1460983027.32244/DBI-1.634/DBI.pm
/root/munin-mysql-master/t/mock/DBI.pm
/usr/local/lib64/perl5/Bundle/DBI.pm
/usr/local/lib64/perl5/DBI.pm
Related questions:
Can't locate DBI.pm
Unable to locate DBI.pm module in Perl
munin-run switches users. The default user is nobody. That user probably does not have permission to read the file.
The script must be run with sufficient privileges, usually as root, as it switches to either munin-node's default user (often "nobody") or any user specifically configured to run the given plugin.
Check with munin-run --debug what user it's running as and check that user can read /usr/local/lib64/perl5/DBI.pm.

mysql error for module DBD::mysql: libmysqlclient.so.15:

i am using mysql for orthomcl software. when i use the command
orthomclLoadBlast my_orthomcl/orthomcl.config my_orthomcl/similarSequence.txt
it gives this error
Can't load '/usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/auto/DBD/mysql/mysql.so' for module DBD::mysql: libmysqlclient.so.15: cannot open shared object file: No such file or directory at /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/DynaLoader.pm line 230, line 5. at /storage/home/cdac/OrthoMCL/orthomclSoftwarev2.0.8/bin/../lib/perl/OrthoMCLEngine/Main/Base.pm line48
Compilation failed in require at /storage/home/cdac/OrthoMCL/orthomclSoftware-v2.0.8/bin/../lib/perl/OrthoMCLEngine/Main/Base.pm line 48, <F> line 5.
How to solve this problem ??
You could install a local perl in your home and you could leave vendor perl untouched.
You could use perlbrew or local::lib to maintain an up to date perl version without modifying the system installed perl.

Need help with perl error in using DBD::mysql

When I run a perl script which uses DBD::mysql , I get the error message:
install_driver(mysql) failed: Can't load '/home/y/lib/perl5/site_perl/5.8/i686-linux-64int/auto/DBD/mysql/mysql.so'
for module DBD::mysql: libmysqlclient.so.16: cannot open shared object file: No such file or directory
at /home/y/lib/perl5/5.8/i686-linux-64int/DynaLoader.pm line 230. at (eval 30) line 3
I am new to perl, but from what I understand it needs mysql.so and it knows the path.
/home/y/lib/perl5/site_perl/5.8/i686-linux-64int/auto/DBD/mysql/mysql.so is present.
Then why the problem?
The file that is missing is libmysqlclient.so.16, not mysql.so. It comes with the mysqlclient package on some distributions.
Make sure /etc/ld.so.conf contains /usr/local/mysql/lib/mysql and /usr/local/mysql/ . If not, add them and run ldconfig.

Need help with perl error in using DBD::mysql [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Need help with perl error in using DBD::mysql
When I run a perl script which uses DBD::mysql , I get the error message:
install_driver(mysql) failed: Can't load '/home/y/lib/perl5/site_perl/5.8/i686-linux-64int/auto/DBD/mysql/mysql.so' for module DBD::mysql: libmysqlclient.so.16: cannot open shared object file: No such file or directory at /home/y/lib/perl5/5.8/i686-linux-64int/DynaLoader.pm line 230.
at (eval 30) line 3
I am new to perl, but from what I understand it needs mysql.so and it knows the path.
/home/y/lib/perl5/site_perl/5.8/i686-linux-64int/auto/DBD/mysql/mysql.so is present.
Then why the problem?
The file that is missing is libmysqlclient.so.16. It comes with the mysqlclient package on some distributions.
Also, Make sure /etc/ld.so.conf contains /usr/local/mysql/lib/mysql and /usr/local/mysql/ . If not, add them and run ldconfig.