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

I am trying to install cpanminus in Strawberry Perl (as part of a project to run some 3D printer software).

When I tried to build, I received an error message saying cpanminus needed to be installed.

C:\Users\David\Documents\3D_Printer\Slic3r>perl Build.PL cpanm was not found. Please install it before running this script. There are several ways to install cpanm, try one of these: apt-get install cpanminus curl -L http://cpanmin.us | perl - --sudo App::cpanminus cpan App::cpanminus If it is installed in a non-standard location you can do: CPANM=/path/to/cpanm perl Build.PL C:\Users\David\Documents\3D_Printer\Slic3r>

I tried cpan App:cpanminus (call this method #3)

C:\Users\David\Documents\3D_Printer\Slic3r>perl -v This is perl 5, version 24, subversion 1 (v5.24.1) built for MSWin32-x +64-multi-thread Copyright 1987-2017, Larry Wall Perl may be copied only under the terms of either the Artistic License + or the GNU General Public License, which may be found in the Perl 5 source ki +t. Complete documentation for Perl, including FAQ lists, should be found +on this system using "man perl" or "perldoc perl". If you have access to + the Internet, point your browser at http://www.perl.org/, the Perl Home Pa +ge. C:\Users\David\Documents\3D_Printer\Slic3r>cpan App::cpanminus Loading internal null logger. Install Log::Log4perl for logging messag +es CPAN: Storable loaded ok (v2.56_01) Reading '\c\Users\David\.cpan\Metadata' Database was generated on Sun, 30 Jul 2017 18:41:02 GMT Running install for module 'App::cpanminus' CPAN: Digest::SHA loaded ok (v5.96) CPAN: Compress::Zlib loaded ok (v2.074) Checksum for \c\Users\David\.cpan\sources\authors\id\M\MI\MIYAGAWA\App +-cpanminus-1.7043.tar.gz ok The system cannot find the path specified. Uncompressed \c\Users\David\.cpan\sources\authors\id\M\MI\MIYAGAWA\App +-cpanminus-1.7043.tar.gz successfully Using Tar:/usr/bin/tar xf "App-cpanminus-1.7043.tar": The system cannot find the path specified. Couldn't untar App-cpanminus-1.7043.tar: child exited with value 1 'YAML' not installed, will not store persistent state MIYAGAWA/App-cpanminus-1.7043.tar.gz Had problems unarchiving. Please build manually C:\Users\David\Documents\3D_Printer\Slic3r>

I also tried, (call this method #1)

C:\Users\David\Documents\3D_Printer\Slic3r>apt-get install cpanminus 'apt-get' is not recognized as an internal or external command, operable program or batch file. C:\Users\David\Documents\3D_Printer\Slic3r>

And I tried, curl... (call this method #2)

C:\Users\David\Documents\3D_Printer\Slic3r>curl -L http://cpanmin.us | + perl - --sudo App::cpanminus 'curl' is not recognized as an internal or external command, operable program or batch file. C:\Users\David\Documents\3D_Printer\Slic3r>

In method #3, I noticed that it is trying to install in \c\Users\... which creates a directory called 'c' off the root of drive C: (i.e. C:\c\Users...etc.). Thus, I see a Unix/DOS naming problem.

I need to use the particular version of Strawberry perl (as described at https://github.com/alexrj/Slic3r/wiki/Running-Slic3r-from-git-on-Windows#installing-a-perl-for-windows) because it is the only version with the necessary features to run Slic3r, which is what I am ultimatly trying to achieve.

What can I do to install cpanminus with my set up?

Replies are listed 'Best First'.
Re: Installing cpanminus in Strawberry Perl on Windows 10
by pryrt (Abbot) on Aug 10, 2017 at 13:34 UTC

    I've never seen a Strawberry Perl installation as new as 5.24 that doesn't include cpanm. Are you sure your perl environment is set up correctly? If you installed into c:\strawberry, with the perl executable in c:\strawberry\perl\bin\perl.exe, then you should already have cpanm as c:\strawberry\perl\bin\cpanm.bat. Please run

    perl -V perl -MApp::cpanminus -le "print 'ok'" perl -le "print for grep { /(berry|perl)/ } split /;/, $ENV{PATH}" cpanm --version
    ... and share the output. The -V gives more verbose info about your Perl installation (that's a capital V this time, compared to the lowercase -v you showed). The -M line will give an error if App::cpanminus isn't installed or findable. The -le will show us relevant portions of your path. The cpanm execution will give some cpanm-specific info if it's found in your path.

    Also, you showed

    c:...>perl -v This is perl 5, version 24, subversion 1 (v5.24.1) built for MSWin32-x +64-multi-thread
    which indicates a 64-bit build (the -x64-). But the Slic3r instructions say in big bold print, "Strawberry Perl (32-bit only)". Oh, sorry, re-reading, I see they have a patched version of 64-bit Perl that they claim works, that they called "Slic3r Perl". Did you grab that, or a 64-bit directly from Strawberry Perl?

      Thank you for your prompt response. I am using the Slic3r Perl version.

      C:\strawberry\perl\bin\perl.exe exists, but C:\strawberry\perl\bin\cpanm.bat does not exist.

      Here is the output of the commands you requested:

      C:\Users\David\Documents\3D_Printer\Slic3r>perl -V Summary of my perl5 (revision 5 version 24 subversion 1) configuration +: Platform: osname=MSWin32, osvers=10.0, archname=MSWin32-x64-multi-thread uname='Win32 strawberry-perl 5.24.1.4 #1 Sun Mar 26 22:24:56 2017 +x64' config_args='undef' hint=recommended, useposix=true, d_sigaction=undef useithreads=define, usemultiplicity=define use64bitint=define, use64bitall=undef, uselongdouble=undef usemymalloc=n, bincompat5005=undef <readmore> Compiler: cc='gcc', ccflags =' -s -O2 -DWIN32 -DWIN64 -DCONSERVATIVE -DPERL +_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fwrapv + -fno-strict-aliasing -mms-bitfields', optimize='-s -O2', cppflags='-DWIN32' ccversion='', gccversion='6.3.0', gccosandvers='' intsize=4, longsize=4, ptrsize=8, doublesize=8, byteorder=12345678 +, doublekind=3 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=1 +6, longdblkind=3 ivtype='long long', ivsize=8, nvtype='double', nvsize=8, Off_t='lo +ng long', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='g++', ldflags ='-s -L"C:\STRAWB~1\perl\lib\CORE" -L"C:\STRAWB~ +1\c\lib"' libpth=C:\STRAWB~1\c\lib C:\STRAWB~1\c\x86_64-w64-mingw32\lib C:\S +TRAWB~1\c\lib\gcc\x86_64-w64-mingw32\6.3.0 libs=-lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 +-ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -l +mpr -lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32 perllibs=-lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdl +g32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_3 +2 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32 libc=, so=dll, useshrplib=true, libperl=libperl524.a gnulibc_version='' Dynamic Linking: dlsrc=dl_win32.xs, dlext=xs.dll, d_dlsymun=undef, ccdlflags=' ' cccdlflags=' ', lddlflags='-mdll -s -L"C:\STRAWB~1\perl\lib\CORE" +-L"C:\STRAWB~1\c\lib"' Characteristics of this binary (from libperl): Compile-time options: HAS_TIMES HAVE_INTERP_INTERN MULTIPLICITY PERLIO_LAYERS PERL_COPY_ON_WRITE PERL_DONT_CREATE_GVSV PERL_HASH_FUNC_ONE_AT_A_TIME_HARD PERL_IMPLICIT_CONTEXT PERL_IMPLICIT_SYS PERL_MALLOC_WRAP PERL_PRESERVE_IVUV USE_64_BIT +_INT USE_ITHREADS USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_LOCALE_TIME USE_PERLIO USE_PERL_ATOF Built under MSWin32 Compiled at Mar 26 2017 22:29:51 @INC: C:/Strawberry/perl/site/lib C:/Strawberry/perl/vendor/lib C:/Strawberry/perl/lib . C:\Users\David\Documents\3D_Printer\Slic3r>perl -MApp::cpanminus -le " +print 'ok'" Can't locate App/cpanminus.pm in @INC (you may need to install the App +::cpanminus module) (@INC contains: C:/Strawberry/perl/site/lib C:/St +rawberry/perl/vendor/lib C:/Strawberry/perl/lib .). BEGIN failed--compilation aborted. C:\Users\David\Documents\3D_Printer\Slic3r>perl -le "print for grep { +/(berry|perl)/ } split /;/, $ENV{PATH}" C:\Strawberry\c\bin C:\Strawberry\perl\site\bin C:\Strawberry\perl\bin C:\Users\David\Documents\3D_Printer\Slic3r>cpanm --version 'cpanm' is not recognized as an internal or external command, operable program or batch file. C:\Users\David\Documents\3D_Printer\Slic3r></readmore>

        Weird. I just did a fresh install of Slic3r's 5.24.1 (64bit). It didn't have cpanm. However, I ran cpan, and within the cpan shell, ran install App::cpanminus, which was successful

        After doing that, I can successfully find and run cpanm:

        I wonder if something got corrupted in your version of Slic3r's 64-bit Strawberry Perl. You might want to try to uninstall and reinstall, then try to install the cpanm from inside the cpan client (it shouldn't make a difference... but since the steps worked for me, maybe they will for you as well).

        If that doesn't work: do you need 64bit? If not, you might follow Slic3r's instructions for the standard 32-bit Strawberry, which does come with cpanm already installed. Given that Slic3r frequently mentions 5.24, and because Strawberry 5.26 changed away from dmake to gmake (which has caused some module installation problems for some people), I'd pick the "Strawberry Perl 5.24.2.1 (32bit)" installer link from Strawberry's main page.)

        update: I should point out that for this test, I was on Windows 7, not Windows 10. It might cause different behavior.

        update 2: If you still have difficulty, you might be able to ask on the Slic3r issues page for them to bundle cpanm with their custom 5.24.1 64bit -- actually, you might want to ask them to do that anyway, given the difficulties you've already had.

Re: Installing cpanminus in Strawberry Perl on Windows 10
by dasgar (Priest) on Aug 10, 2017 at 13:45 UTC

    Strawberry Perl comes with App::cpanminus already installed. According to the release notes for Strawberry Perl 5.24.0.1 64-bit (see here), App::cpanminus version 1.7041 is already installed.

      Indeed, Windows 10 x64 with Strawberry 5.24.1 64-bit:

      VinsWorldcom@C:\Users\VinsWorldcom> ver Microsoft Windows [Version 10.0.14393] VinsWorldcom@C:\Users\VinsWorldcom> perl -v This is perl 5, version 24, subversion 1 (v5.24.1) built for MSWin32-x +64-multi-thread Copyright 1987-2017, Larry Wall [...] VinsWorldcom@C:\Users\VinsWorldcom> perl -MApp::cpanminus -e "print $A +pp::cpanminus::VERSION" 1.7042 VinsWorldcom@C:\Users\VinsWorldcom> ls \strawberry\perl\vendor\lib\App +\cpanminus* Directory of C:\strawberry\perl\vendor\lib\App [cpanminus] cpanminus.pm 1 File(s) 7,944 bytes