Question

I am trying to install Spreadsheet::ParseExcel to use with ExcelLatex. This is what I did: Installed Active perl, Then install CPAN.pm by perl -MCPAN -e shell I was asked for configuration and mirror site and I let perl do the auoconfoguration. At the end I got the following message: Autoconfiguration complete.Then I tried: perl -MCPAN -e 'install "Spreadsheet::WriteExcel"' And it tried to install it but at the end I got the following error:

ERROR: Can't create '/Library/Perl/5.12/Spreadsheet'
mkdir /Library/Perl/5.12/Spreadsheet: Permission denied at     /System/Library/Perl/5.12/ExtUtils/Install.pm line 494

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 at -e line 1
make: *** [pure_site_install] Error 13
  JMCNAMARA/Spreadsheet-WriteExcel-2.37.tar.gz
  /usr/bin/make install  -- NOT OK

I really appreciate it one please help me how I can solve the problem

Was it helpful?

Solution

It is trying to create a directory in the root (mkdir /Library/Perl/5.12/Spreadsheet)

You have to be root to be able to do that.

You may could use PerlBrew or local::lib to install your perl libs into your home dir.

  # Install Spreadsheet::WriteExcel and its missing dependencies to the '~/perl5' directory
  perl -MCPAN -Mlocal::lib -e 'CPAN::install(Spreadsheet::WriteExcel)'

  # Just print out useful shell commands
  $ perl -Mlocal::lib
  export PERL_MB_OPT='--install_base /home/username/perl5'
  export PERL_MM_OPT='INSTALL_BASE=/home/username/perl5'
  export PERL5LIB='/home/username/perl5/lib/perl5/i386-linux:/home/username/perl5/lib/perl5'
  export PATH="/home/username/perl5/bin:$PATH"
  #create a environment setting script and execute it.
  perl -Mlocal::lib > ~/.setenv && . ~/.setenv

Regards,

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top