Search code examples
windowsperlcpan

Making cpan run properly on windows 10


I am trying to make cpan work on windows 10 professional. I have Perl 5.26 installed as well as dmake. But whenever I try to install anything
it comes up with errors. is there anything more I need in order to run cpan properly?

I get errors like Warning: Prerequisite 'invoker => 0' for 'AUDREYT/methods-0.12.tar.gz' failed when processing

And also that it is missing the link command. Is it possible to get cpan to work properly on windows or should I just leave it be and just use precompiled modules? Here is the output of trying to install Inline::Python. I have put it on pastebin as it is fairly long: The command is

    install Inline::Python  

pastebin


Solution

  • From your vague description, I assume that the build tools (compiler, linker) are not available on your development machine. If you tell us the module name you're trying to install and the command you're using to install, we can likely provide better answers that also help you. Please also post the exact error message(s) you're getting.

    Strawberry Perl comes with the C compiler and linker included.

    For ActiveState Perl, you can install them by typing the following commands at the command line:

    ppm install MinGW
    

    Regarding your update, you are installing Inline::Python and it fails for you:

            2. LIBRARY option. The location of the python library.
               Inline::Python needs to link against it to use Python.
    
            Here are the libraries I know about:
               1) C:/Python26/libs/python26.lib
    
    Which? Or enter another. [1] C:\ProgramData\Anaconda3
    ...
    Using These Settings:
       Extra Libs:
       Python Lib:  -LC:/ProgramData Anaconda3
       Includes:    -IC:/Python26/include
       Extra Flags: none (perl Makefile.PL --help for details)
    

    This looks wrong:

       Python Lib:  -LC:/ProgramData Anaconda3
    
    ...
    Warning (mostly harmless): No library found for Anaconda3
    

    The above warning is not harmless, as it mostly means that Inline::Python is looking for a library Anaconda3, which is wrong.

    My suggestion is that you try entering the library with forward slashes:

    Which? Or enter another. [1] C:/ProgramData/Anaconda3
    

    or maybe

    Which? Or enter another. [1] C:/ProgramData/Anaconda3/python
    

    Also, you can much better and easier debug the installation and compilation of a module if you manually perform its install steps, but before you start, see below! In your case, the steps would be:

    Launch the cpan client

    cpan
    

    Download and unpack Inline::Python

    look Inline::Python
    

    Run the Makefile.PL build process

    perl Makefile.PL
    nmake
    nmake test
    nmake install
    

    Ideally, none of the above steps should fail.

    You have the same problem with Proc::ProcessTable, and the problem here is that this module does not work on Windows. I don't know why Inline::Python relies on it, but unless you find a precompiled Inline::Python for Windows, you will not be able to use either module.

    See also

    ActiveState documentation