-1

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

Tobbes
  • 41
  • 11
  • Are you using Active State's version of Perl or Strawberry Perl or some other version? – JGNI Oct 09 '18 at 09:00
  • Also, what module are you trying to install, and what error messages do you actually get? Please paste them here instead of describing them. – Corion Oct 09 '18 at 10:23
  • Sorry I have updated above, I am using active state's perl. – Tobbes Oct 09 '18 at 11:24
  • I've updated my reply for the module you're trying to use. `Inline::Python` can't work on Windows. But your pastebin doesn't include your above error message, so maybe there is something else wrong?! – Corion Oct 09 '18 at 18:25

2 Answers2

0

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

Corion
  • 3,855
  • 1
  • 17
  • 27
-1

From your update Active state's version of Perl uses a script called ppm to install pre-compiled packages from their repository. If the module you want isn't in their repository then you are stuck.

In that case I'd advise installing Strawberry Perl which comes with a complete tool chain and will handle any cpan module created with Windows in mind.

JGNI
  • 3,933
  • 11
  • 21
  • Ah, so it is impossible to run cpan with active state's version of perl? – Tobbes Oct 09 '18 at 11:45
  • It might work for a pure Perl module, but without a lot of work you will have problems with anything that compile up from source code other than Perl – JGNI Oct 09 '18 at 12:15
  • @Tobbes, You most definitely can. Ignore JGNI's claims. – ikegami Oct 09 '18 at 12:32
  • @ikegami I'd like to know how. Can you add an answer describing how you would do it? – JGNI Oct 09 '18 at 15:03
  • `cpan Inline::Python`. It automatically installs dmake and mingw if you don't have them – ikegami Oct 09 '18 at 18:35
  • From the Supported Platforms section of the Inline::Python documentation `Inline::Python has been tested on RedHat Linux 6.2 with a variety of different Perl and Python configurations. It also seems to be running pretty well on openSUSE at least from 10.3 to 13.1 and on Solaris. Previous versions of Inline::Python worked on Windows and Cygwin -- this version has never been tested there. I strongly suspect it will require patching. Please send me patches.` So it looks like it simply won't work on Windows at the moment – JGNI Oct 10 '18 at 07:31
  • @JGNI, What does that have to do with me? All I said is that your claims about AP are all wrong. You're not stuck if it's not in their repository any more than you are with SP. AP will automatically install and use dmake and mingw if necessary, allowing one to use `cpan` with `AP` just as one can with `SP`. – ikegami Oct 10 '18 at 07:32
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/181598/discussion-between-jgni-and-ikegami). – JGNI Oct 10 '18 at 07:33