需要安装Spreadsheet :: ParseExcel的帮助

时间:2012-10-29 02:56:09

标签: perl cpan parseexcel

我正在尝试安装Spreadsheet :: ParseExcel以与ExcelLatex一起使用。这就是我做的: 已安装Active perl,然后按perl -MCPAN -e shell安装CPAN.pm 我被要求配置和镜像站点,我让perl做auoconfoguration。最后,我收到以下消息:Autoconfiguration complete.然后我尝试了: perl -MCPAN -e 'install "Spreadsheet::WriteExcel"' 它试图安装它,但最后我得到以下错误:

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

我真的很感激,请帮助我如何解决问题

1 个答案:

答案 0 :(得分:3)

尝试在根目录中创建一个目录(mkdir /Library/Perl/5.12/Spreadsheet)

你必须是root才能做到这一点。

您可以使用PerlBrewlocal::lib将perl libs安装到您的家庭目录中。

  # 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

此致