Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Trying to install the Number::Format module, but I keep getting this error. I get a similar error if I try to install this YAML module.

I don't think I should be running out of memory...

pi@raspberrypi:~ $ cpan Number::Format Reading '/home/pi/.cpan/Metadata' Database was generated on Wed, 07 Feb 2018 12:41:02 GMT Running install for module 'Number::Format' Checksum for /home/pi/.cpan/sources/authors/id/W/WR/WRW/Number-Format- +1.75.tar.gz ok Uncompressed /home/pi/.cpan/sources/authors/id/W/WR/WRW/Number-Format- +1.75.tar.gz successfully Using Tar:/bin/tar xf "Number-Format-1.75.tar": Couldn't untar Number-Format-1.75.tar: 'Cannot allocate memory' 'YAML' not installed, will not store persistent state WRW/Number-Format-1.75.tar.gz Had problems unarchiving. Please build manually

Replies are listed 'Best First'.
Re: Number::Format fails to install
by marto (Cardinal) on Feb 07, 2018 at 13:40 UTC

    You're working on a system with limited resources, I installed it here on a system with the same amount of RAM as the Raspberry pi (the 1GB models anyway :), without any issues. If your pi is currently doing lots of other work consider trying to use cpanm to install modules, it's lighter on system resources and faster:

    cpanm Number::Format

    A while ago I detailed some tweaks to make better use of resources on the Raspberry Pi, some of which may still be applicable.

    Update: added clarification of pi model.

Re: Number::Format fails to install
by Corion (Patriarch) on Feb 07, 2018 at 13:41 UTC
    Couldn't untar Number-Format-1.75.tar: 'Cannot allocate memory'

    It seems that your system is very low on memory. Maybe (maybe) installing the module through a tool with a smaller memory footprint might work. For example you can try to use App::cpanm / https://cpanmin.us to install the module automatically.

    If that still fails due to not enough memory being available, you can still do the installation steps manually. See the included README file of the distribution on how to install it.

    If these manual steps still fail due to not enough memory being available, you will have to build the module on a different machine and then copy the appropriate resulting files to your target machine, but that should be an approach of last resort.

    If you are using the system perl, instead of installing modules from CPAN consider installing the prepackaged modules as provided by your OS / distribution vendor. For example, Debian-derived distributions usually follow the naming convention libmodule-name-perl, so in your case maybe a kind Debian packager provides a package libnumber-format-perl for your distribution.

Re: Number::Format fails to install
by hippo (Archbishop) on Feb 07, 2018 at 13:53 UTC
    I don't think I should be running out of memory

    And yet it would seem that you are. Do you have any numbers to back up this hunch?

    Had problems unarchiving. Please build manually

    What happened when you tried to build manually?