Perl 5.16 on windows 7 failed to install Template Toolkit - windows

I tried to install Perl 5.16 module 'Template-Toolkit' on windows 7 by using this command in cmd:
C:>ppm install Template-Toolkit
ppm install failed: Can't find any package that provides Template-Toolkit
All other modules I installed (AppConfig, DBI, DBD-mysql, MailTools, GD, Chart, GDGraph, ..) succeeded.
Following this webpage as a guide, they mention (under ActivateState Perl section) that you may not install Perl into a directory that contains a space (eg "C:\Program Files"), because it will break the Template-Toolkit installer. Since I installed Perl directly in 'C:\' -> 'C:\Perl64\', this could not be the case.
Is there a solution for this problem? Or should I use an older version of Perl, mentioned here?

The only errors in the error log are errors in the documentation (minor encoding issues).
The module could be installed safely. Just use cpan to do it. You'll just have to force the installation.
C:\>cpan
cpan> install Template
For me, that runs without issue. (The failing tests are skipped since they're dev-only tests.) If if fails for you and the only failures are the two errors from t/zz-pod-kwalitee.t, you can safely follow up with
cpan> force install Template

According to the ppm template-toolkit page, the build for ActiveState's Perl 5.16 failed (which is why it isn't available).
Your options seem to be:
Fix whatever bug is stopping it being built (it looks like it is just a couple of tests on the POD, so it could be an easy fix)
Use an older version of ActiveState Perl
Use a different distribution of Perl for Windows (such as Strawberry Perl)
Use a different operating system (e.g. Ubuntu in a virtual machine)

I got Warning and Error messages after these commands:
C:\>cpan
cpan> install Template
Please seen the screen shot below.

I haven't tried it myself but you can get Template::Alloy from the ActiveState PPM: http://metacpan.org/pod/Template::Alloy which claims it supports the TT2 syntax among others.

Related

Can't build the haskell shakespeare library on windows 10. Any ideas?

I'm trying to install Yesod through cabal on my HP computer, but the building process fails when shakespeare library gets the turn. MSYS2+MinGW in the path, the rest actually works. What could be the issue? I have my suspicions that it might be due to the x64 processor I have, but not sure.
Tried installing globally with runhaskell, but same story.
C:\Users\Ivan Kretov>cabal install shakespeare
Warning: The install command is a part of the legacy v1 style of cabal
usage.
Please switch to using either the new project style and the new-install
command or the legacy v1-install alias as new-style projects will become
the default in the next version of cabal-install. Please file a bug if
you cannot replicate a working v1- use case with the new-style commands.
For more information, see: https://wiki.haskell.org/Cabal/NewBuild
Resolving dependencies...
Starting shakespeare-2.0.20
Building shakespeare-2.0.20

How to install GnuPlot on windows?

A Unix (mac/Linux) user who has been forced to work on a windows machine here :)
I have scripted loads of work in GnuPlot and don't want to switch to other programs at this moment. I would appreciate it if you could help me know how to install GnuPlot On windows (more specifically windows 10). questions:
I know there are two options according to this page, Cygwin and MinGW. which one is better?
I have MinGW installed and I know I need to install one of the options from this page but I don't know which one(s)! and how.
I have searched the internet but it seems most of the search results are for compiling. I don't want to go through compiling and all the hassle.
I tried installing the binary from this link, and when I try to run the program this is the error I get:
Unable to execute file:
C:\Program Files\gnuplot\bin\wgnuplot.exe
CreatProcess failed; Code267.
The directory name is invalid.
I would appreciate it if you could give me a very simple stepwise installation (1 2 3 ...), preferably with visuals, and instructions.
P.S. A nice way to install Free, Libre, and Open Source Software (FLOSS) on Windows and keep them updated, is to use package managers like Chocolatey. There are GnuPlot chocolatey packages here. Just install choco as instructed here. Then use choco install Gnuplot to have the software installed.
You don't have to install MinGW or Cygwin. Actually packages compiled in MinGW are compatible with Windows. Just download the binary of gnuplot from Their repo and you are good to go.
Additional points:
When installing, check which terminals you want to set up; also
check if you want the installer to add the PATH variable to your
system. Also, create a desktop shortcut.
After installation, you should see the desktop shortcut. Clicking on it should open a terminal-based gnuplot (which hopefully you are familiar with).
Please note that I have used the x11 terminal (you can get this working by installing xming). There are other options such as windows and qt terminals, but I am not an expert on using these.
You should have Administrator rights on this machine.
Right click on MinGW, Run as Administrator, install - should be OK.
Good luck!
BR, Alex
You can try
$~ scoop install gnuplot
Installing 'Gnuplot' (5.4.5) [64bit] from main bucket
gp545-win64-mingw.7z (37.7 MB) [=======================================] 100%
Checking hash of gp545-win64-mingw.7z ... ok.
Extracting gp545-win64-mingw.7z ... done.
Linking ~\scoop\apps\Gnuplot\current => ~\scoop\apps\Gnuplot\5.4.5
Creating shim for 'gnuplot'.
Creating shortcut for GNUPlot (wgnuplot.exe)
'Gnuplot' (5.4.5) was installed successfully!

How to install and use "make" in Windows?

I'm following the instructions of someone whose repository I cloned to my machine. I want to use the make command as part of setting up the code environment, but I'm using Windows. I searched online, but I could only find a make.exe file, a make-4.1.tar.gz file (I don't know what to do with it next) and instructions for how to download MinGW (for GNU; but after installing it I didn't find any mention of "make").
How do I use make in Windows without a GNU compiler or related packages?
make is a GNU command so the only way you can get it on Windows is installing a Windows version like the one provided by GNUWin32. Anyway, there are several options for getting that:
The most simple choice is using Chocolatey. First you need to install this package manager. Once installed you simlpy need to install make (you may need to run it in an elevated/admin command prompt) :
choco install make
Other recommended option is installing a Windows Subsystem for Linux (WSL/WSL2), so you'll have a Linux distribution of your choice embedded in Windows 10 where you'll be able to install make, gccand all the tools you need to build C programs.
For older Windows versions (MS Windows 2000 / XP / 2003 / Vista / 2008 / 7 with msvcrt.dll) you can use GnuWin32.
An outdated alternative was MinGw, but the project seems to be abandoned so it's better to go for one of the previous choices.
GNU make is available on chocolatey.
Install chocolatey from here.
Then, choco install make.
Now you will be able to use Make on windows.
I've tried using it on MinGW, but it should work on CMD as well.
The accepted answer is a bad idea in general because the manually created make.exe will stick around and can potentially cause unexpected problems. It actually breaks RubyInstaller: https://github.com/oneclick/rubyinstaller2/issues/105
An alternative is installing make via Chocolatey (as pointed out by #Vasantha Ganesh K)
Another alternative is installing MSYS2 from Chocolatey and using make from C:\tools\msys64\usr\bin. If make isn't installed automatically with MSYS2 you need to install it manually via pacman -S make (as pointed out by #Thad Guidry and #Luke).
If you're using Windows 10, it is built into the Linux subsystem feature. Just launch a Bash prompt (press the Windows key, then type bash and choose "Bash on Ubuntu on Windows"), cd to the directory you want to make and type make.
FWIW, the Windows drives are found in /mnt, e.g. C:\ drive is /mnt/c in Bash.
If Bash isn't available from your start menu, here are instructions for turning on that Windows feature (64-bit Windows only):
https://learn.microsoft.com/en-us/windows/wsl/install-win10
Download make.exe from their official site GnuWin32
In the Download session, click
Complete package, except sources.
Follow the installation instructions.
Once finished, add the <installation directory>/bin/ to the PATH variable.
Now you will be able to use make in cmd.
Install Msys2 http://www.msys2.org
Follow installation instructions
Install make with $ pacman -S make gettext base-devel
Add C:\msys64\usr\bin\ to your path
On windows 10 or 11, you can run the command winget install GnuWin32.Make in the command line or powershell to quickly install it. Than you can use the command cmake.
There is no need to install choco anymore.
The chances are that besides GNU make, you'll also need many of the coreutils. Touch, rm, cp, sed, test, tee, echo and the like. The build system might require bash features, if for nothing else, it's popular to create temp file names from the process ID ($$$$). That won't work without bash. You can get everything with the popular POSIX emulators for Windows:
Cygwin (http://www.cygwin.org/) Probably the most popular one and the most compatible with POSIX. Has some difficulties with Windows paths and it's slow.
GNUWin (http://gnuwin32.sourceforge.net/) It was good and fast but now abandoned. No bash provided, but it's possible to use it from other packages.
ezwinports (https://sourceforge.net/projects/ezwinports) My current favorite. Fast and works well. There is no bash provided with it, that can be a problem for some build systems. It's possible to use make from ezwinports and bash from Cygwin or MSYS2 as a workaround.
MSYS 1.19 abandoned. Worked well but featured very old make (3.86 or so)
MSYS2 (https://www.msys2.org/) Works well, second fastest solution after ezwinports. Good quality, package manager (pacman), all tooling available. I'd recommend this one.
MinGW abandoned? There was usually MSYS 1.19 bundled with MinGW packages, that contained an old make.exe. Use mingw32-make.exe from the package, that's more up to date.
Note that you might not be able to select your environment. If the build system was created for Cygwin, it might not work in other environments without modifications (The make language is the same, but escaping, path conversion are working differently, $(realpath) fails on Windows paths, DOS bat files are started as shell scripts and many similar issues). If it's from Linux, you might need to use a real Linux or WSL.
If the compiler is running on Linux, there is no point in installing make for Windows, because you'll have to run both make and the compiler on Linux. In the same way, if the compiler is running on Windows, WSL won't help, because in that environment you can only execute Linux tools, not Windows executables. It's a bit tricky!
I could suggest a step by step approach.
Visit GNUwin
Download the Setup Program
Follow the instructions and install GNUWin. You should pay attention to the directory where your application is being installed. (You will need it later1)
Follow these instructions and add make to your environment variables. As I told you before, now it is time to know where your application was installed.
FYI: The default directory is C:\Program Files (x86)\GnuWin32\.
Now, update the PATH to include the bin directory of the newly installed program.
A typical example of what one might add to the path is: ...;C:\Program Files (x86)\GnuWin32\bin
Another alternative is if you already installed minGW and added the bin folder the to Path environment variable, you can use "mingw32-make" instead of "make".
You can also create a symlink from "make" to "mingw32-make", or copying and changing the name of the file. I would not recommend the options before, they will work until you do changes on the minGW.
I once had the same problem. But I am surprised not to find one particular solution here.
Installation from GnuWin32 or via winget are good and easy options. But I only found make 3.8.1 there. This version lacks the very important option -O, which handles the output correctly when compiling multithreaded.
choco appears to offer make 4.3, currently. So one could expect recent versions there.
But there is also the option of self compiling. And if you have to install make, which is used for compiling, this should be a valid option.
head to https://www.gnu.org/software/make/ and download a version of your liking
unpack the tar.gz files (use 7zip and unpack the file twice to retrieve the actual content)
navigate to the created directory
open command prompt in that directory
run build_w32.bat gcc This will start the compilation with the gcc compiler, which you would need to install in advance. When running build_w32.bat without any option they try to use the MSVC compiler. Sidenote: I found it surprising that gnu does not use gcc as default but MSVC :-)
ignore the warnings created during compilation. The result should still be fine
retrieve your fresh gnumake.exe from the directoy GccRel (when compiled with gcc)
put this file somewhere where you like and rename to make.exe
add the location to the system variable %PATH%
As others have noted: This manual installation might cause conflicts if you have various make versions installed by other programs as well.
You can also install scoop, then run:
scoop install make
One solution that may helpful if you want to use the command line emulator cmder. You can install the package installer chocately. First we install chocately in windows command prompt using the following line:
#"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
refreshenv
After chocolatey is installed the choco command can be used to install make. Once installed, you will need add an alias to /cmder/config/user_aliases.cmd. The following line should be added:
make="path_to_chocolatey\chocolatey\bin\make.exe" $*
Make will then operate in the cmder environment.
Install npm
install Node
Install Make
node install make up
node install make
If above commands displays any error then install Chocolatey(choco)
Open cmd and copy and paste the below command (command copied from chocolatey URL)
#"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command " [System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"

Running PyPDFOCR on Windows via Python - Requiring Poppler?

I'm working on a project that requires the conversion of PDFs into their searchable counterparts, and have found that PyPDFOCR does exactly what I need to get the job done. However, when trying to install the module and its external dependencies, I'm running into issues where I can't download anything windows-related that defines pdfimages such as Poppler. I've search all around for any ways to install Poppler in order to run the module, but nothing seems to be supported or working. Any ideas?
Have you tried the Poppler download from:
https://sourceforge.net/projects/poppler-win32/ for Windows platform
https://poppler.freedesktop.org/ for Linux platform

How do you build perl source code to target Windows?

I've got some perl source code here, how do I build it on Windows, to get a windows binary that I can work with?
Usage of external tools normally comes with compatibility issues, random errors etc. You are better off using the inbuilt perl 'pp' tool. Install PAR::Packer (which includes the pp tool) module and then read the manual for it...
It allows you to pack your perl scripts to executables, and has options as what modules and dependencies to include, I've used it on winXP and win7 and never had an issue with any executabe produced.
pp manual
I've found Cava Packager to be just what I needed.
(source: cavapackager.com)
How to compile Perl scripts into EXEs
Download ActivePerl 5.10 for Windows.
Install it.
Restart your PC.
Download Cava Packager
Install it.
Open it.
Make a new project choosing a blank folder.
Scripts > Add..
Choose your .PL script file
Perl library > [...]
Choose "C:\Perl\bin\perl510.dll"
Add
Choose "C:\Perl\lib\"
Save
Build
You could use the Perl Development Kit from ActiveState to "compile" your script to a .exe file. I used it to create binaries of MRTG and a couple tools more to be deployed on windows servers running as a service. There used to be another product (from IndigoStar or something) called perl2exe I think to get the same result.
Just a note that Cava Packager also supports creating executables from Perl code on Linux and Mac OS X in addition to the original Windows version.
Note: As indicated by my name, I am affiliated with Cava Packager.

Resources