是否有人能够使用PDL (Perl数据语言)在Windows上使用Strawberry Perl的PDL版本创建情节?
我在Windows 10 (64位)上安装了来自http://strawberryperl.com/releases.html的Strawberry Perl 5.30.1.1的PDL版本,启动了PDL (pdl2),并试图显示第一个例子(2015年版)中描述的情节:
pdl> use PDL::Graphics::Simple
pdl> imag (sin(rvals(200,200)+1))但得到
Trying gnuplot (PDL::Graphics::Gnuplot)...nope
Trying pgplot (PDL::Graphics::PGPLOT::Window)...nope
Trying plplot (PDL::Graphics::PLplot)...nope
Trying prima (PDL::Graphics::Prima)...nope
Runtime error: Sorry, all known plotting engines failed. Install one and try again.尽管gnuket5.2补丁级别6包含在草莓Perl的那个版本中。
我发现,由于Alien::gnuketv1.033中的一个问题,PDL没有检测到gnuplot。如果我将Alien::Gnuplot::load_gnuplot中特定于Windows的部分更改为
if($^O =~ /MSWin32/i) {
if( $exec_path =~ m/([\"\*\?\<\>\|])/ ) {
die "Alien::Gnuplot: Invalid character '$1' in path to gnuplot -- I give up" ;
}
use Win32::Job;
my $job = Win32::Job->new;
open my $ofh, ">$file";
if (defined $ofh) {
my $pid = $job->spawn(undef, qq{"$exec_path" ${file}_gzinta},
{ no_window => 1, stdout => $ofh, stderr => $ofh });
if (defined $pid) {
$job->run(3); # wait at most 3 seconds for job to finish
}
}
}然后运行PDL示例将产生:
Trying gnuplot (PDL::Graphics::Gnuplot)...PDL::Graphics::SImple: Gnuplot exists but yours doesn't support either the x11 or wxt terminal
Trying pgplot (PDL::Graphics::PGPLOT::Window)...nope
Trying plplot (PDL::Graphics::PLplot)...nope
Trying prima (PDL::Graphics::Prima)...nope
Runtime error: Sorry, all known plotting engines failed. Install one and try again.因此,可以检测到gnuplot,但显然不能满足一些额外的要求。
因此,似乎随草莓Perl 5.30.1.1版本的PDL版本在Windows上是不适合PDL使用的,即使Alien::Gnuplot问题是固定的--但似乎奇怪的是,随机用户(me)应该首先注意到这一点。还是我做错什么了?
我在https://rt.cpan.org/Ticket/Display.html?id=131361上报告了这个明显的错误,但我对其他用户在Windows上使用此版本的体验很感兴趣。
编辑2020-01-10:https://pdl.perl.org说草莓Perl的PDL版本是在Windows上安装PDL的“绝对最简单的方法”,并且没有提到任何其他需要安装的东西。
它还提到了一种“可供选择的简单方式”,包括显式安装PGPLOT,这是PDL试图使用的其他图形引擎之一。
其含义是,“绝对最简单的方式”不需要额外的工作来安装图形引擎,但我的经验是不同的。
我的问题不是“我还需要安装什么东西才能让我的PDL使用图形引擎?”我想知道它是否能像“绝对最简单的方法”所暗示的那样,能在盒子里发挥作用。
发布于 2022-03-10 20:26:13
遗憾的是,在编写本报告时,对Windows的PDL图形支持有点少。demo 3d命令可以工作(演示PDL::Graphics::TriD),但正如您注意到的那样,PDL::Graphics::Simple支持的各种图形驱动程序在各种方面功能不足。
好消息是,这些举措都是为了纠正这一问题--比如Alien::PLplot,旨在允许在Windows上安装PLplot。如果您想要帮助您(要么编写代码,要么测试,甚至只是报告特定的问题),请查看各个模块的GitHub页面,了解当前跟踪的问题:
https://stackoverflow.com/questions/59601754
复制相似问题