我目前正在尝试 - 安装 perl PDL 失败,因为我想自动化我的一些数据分析和图形生成。
不幸的是,我似乎无法毫无问题地安装必要的模块,更不用说创建一个小脚本来处理我的数据文件了。
我对 Perl 有一些初步的经验,但没什么特别的,我正在使用 Windows 10 x64。
最初我选择了 x64 草莓 perl v5.24 安装,然后是 Astro::FITS::Header、Convert::UU、OpenGL 和 PDL 的 ppm 安装 - 按照此处的说明http://pdl.perl.org/?page =安装。但是,安装 Inline::C 并尝试了 PDL_Book_Latest http://sourceforge.net/projects/pdl/files/PDL/2.4.10/PDL-Book-20120205第 5 页上列出的示例后存在问题.pdf/download没有出现任何图像,也没有图像文件出现在我想搜索的任何位置。回到谷歌,仍然没有找到关于这个问题来源的任何信息,所以我决定回到原点并使用旧版本,希望它会有更好的文档记录。
因此,通过 Windows 安装程序对话框卸载草莓 perl,删除草莓文件夹和包含“草莓”的注册表项。然后使用 Padre IDE v5.14 重新安装 perl - 也许一些调试功能将有助于查明错误。开始安装相同的模块(Astro::FITS::Header、Convert::UU、OpenGL、PGPLOT)。Astro 和 Convert 工作正常,但是 OpenGL 开始抛出关于 ExtUtils::F77 的错误,经过几个小时的搜索,我显然错过了这些错误。我去安装这个模块,它不断给出关于“gfortan”是一个未知命令的错误......我的理解是,PDL 的想法是避免 fortran 和 C,我发现几乎没有关于这个安装问题的信息至今。
所以我决定尝试另一种方法。我从 cpan 安装了 ppm 模块,并通过 ppm 命令重复了初始安装过程。这次我得到:
“在 SOFTPKG 中发现未知元素‘提供’。位于 C:/Dwimperl/perl/site/lib/PPM.pm 第 1462 行。”
所以我的问题如下:
我是否错过了安装过程中的一些关键步骤?我的系统是否真的处理得很糟糕,如果是这样,是否有任何可能的解决方法?我尝试了两个不同版本的事实是否可能会产生可能是该问题根源的路径问题?
任何人都可以提供替代且最好不要太复杂的路线来在 Windows 10 上使用给定的 perl 安装来安装 PDL?
编辑1:
这是我尝试安装 Inline::C 时出现的错误代码,这是 PDL 的明显先决条件
code deleted to make space for updates...
编辑 3:
我在PATH指定的目录中重新安装了GnuWin32,而不是更改PATH,然后再次尝试安装。Inline::C 给出了相同的 'diff' 和 'rm' 错误。所以我运行“cpanm --notest 'package'”来安装 Inline::C 然后 PDL,都说他们成功了。然而,即使使用'--notes' cpanm 也无法安装 OpenGL 和 PGPLOT。
最终目标是能够使用 PGPLOT 中的函数生成图形:例如
# use PDL;
# use PDL::Graphics::PGPLOT;
# imag(sin(rvals(200,200)+1));
但是,如果 PGPLOT 无法安装,这当然不起作用。
编辑4:
尝试了@Dr.Avalange 在 sourceforge https://sourceforge.net/p/pogl/bugs/26/上找到的修复程序,并注意到我似乎有这个文件的多个副本。
这正常吗……?
编辑 5:所以我卸载了 perl,删除了我可以在 %APPDATA%、%USERPROFILE% 和 C:/DWIM 中找到的任何挥之不去的文件,然后运行 ccleaner 以防万一我错过任何东西。
然后我为 Windows 下载了 Strawberry perl 5.24.1 x64 并安装了它。
在此之后,我按照http://pdl.perl.org/?page=install运行了 'cpanm Astro::FITS::Header'、cpanm 'Convert-UU' 和 'cpanm OpenGL' 。这一切都很好。然后我运行“cpanm PDL”,它安装了 Inline、Pegex、Win32::Mutex 和 Module::Compile 依赖项。但是,如果与您之前提到的 Inline::C 有相同的错误。
我之前已经安装了 GetGnuWin32,所以不知道为什么这不起作用。Windows 'Path' 环境(不是 PATH - 根据高级系统对话不存在)被记录为
%USERPROFILE%\AppData\Local\Microsoft\WindowsApps; 在这个目录中,我有 GetGnuWin32 文件夹,它应该已经安装了您提供的链接中的所有软件包,除非我错过了正确安装它的补充步骤?所以我重新下载了 DiffUtils 设置并运行它,安装到 \programfiles(x86) (默认选项)。然后我重新运行'cpanm PDL'。
我仍然收到相同的“差异”错误消息。那么 DiffUtils 是否安装不正确?(我确实在尝试之间和安装后关闭并重新打开了命令行)
编辑 6:
因此,在使用 --notest 安装 PDL 和 PGPLOT 后,我尝试运行以下测试,但失败了。见下文
C:\Windows\system32>perldl
perlDL shell v1.357
PDL comes with ABSOLUTELY NO WARRANTY. For details, see the file
'COPYING' in the PDL distribution. This is free software and you
are welcome to redistribute it under certain conditions, see
the same file for details.
ReadLines, NiceSlice, MultiLines enabled
Reading PDL/default.pdl...
Found docs database C:/Strawberry/perl/site/lib/PDL/pdldoc.db
Type 'help' for online help
Type 'demo' for online demos
Loaded PDL v2.017 (supports bad values)
Note: AutoLoader not enabled ('use PDL::AutoLoader' recommended)
pdl> use PDL::Graphics//PLplot
Unknown regexp modifier "/P" at (eval 62) line 4, at end of line
Unknown regexp modifier "/L" at (eval 62) line 4, at end of line
Unknown regexp modifier "/t" at (eval 62) line 4, at end of line
BEGIN not safe after errors--compilation aborted at (eval 62) line 5, <DATA> line 207.
pdl> use PDL::Graphics::PLplot
Can't locate PDL/Graphics/PLplot.pm in @INC (you may need to install the PDL::Graphics::PLplot module) (@INC contains: C:/Strawberry/perl/site/lib/MSWin32-x64-multi-thread C:/Strawberry/perl/site/lib C:/Strawberry/perl/vendor/lib C:/Strawberry/perl/lib .) at (eval 72) line 5.
BEGIN failed--compilation aborted
pdl> use PDL
pdl> use lib 'C:/Strawberry/perl/site/lib/PDL/Graphics'
pdl> use PGPLOT
pdl> use PDL::Graphics::PGPLOT
pdl> imag(sin(rvals(200,200)+1))
Undefined subroutine &PDL::Graphics::PGPLOT::pgqinf called at C:/Strawberry/perl/site/lib/PDL/Graphics/PGPLOT.pm line 408, <DATA> line 90.
pdl> exit
C:\Windows\system32>cpanm PDL::Graphics::PGPLOT::pgqinf
! Finding PDL::Graphics::PGPLOT::pgqinf on cpanmetadb failed.
! Finding PDL::Graphics::PGPLOT::pgqinf () on mirror http://www.cpan.org failed.
! Couldn't find module or a distribution PDL::Graphics::PGPLOT::pgqinf
C:\Windows\system32>cpan PDL::Graphics::PGPLOT::pgqinf
Loading internal null logger. Install Log::Log4perl for logging messages
CPAN: CPAN::SQLite loaded ok (v0.211)
Database was generated on Thu, 13 Apr 2017 13:49:14 GMT
C:\Windows\system32>
已经存在目录问题,但我设法将其指向我认为的正确方向。还尝试安装 PLplot 'cpanm' 表示安装成功,但没有 .pm 文件,在另一个目录中只有一个 .pd ,因此使用 PDL::Graphics::PLplot 失败,因为找不到 .pm 文件。
编辑:7所以这次重试ppm install http://www.sisyphusion.tk/ppm/PGPLOT.ppd
似乎有效,因为您提供的解释中的链接不再使用
http://www.kalinabears.com.au/w32perl/pgplot-5.2.2-mingw32.tar.bz2
http: //jrfonseca.home.dyndns.org/projects/gnu-win32/software/ported/patches/pgplot-5.2.2-mingw32.diff.gz
虽然这似乎有效,但没有列出文件的痕迹根据安装的需要,除非他们只是为了这个特定的方法?
pgplot/bin/cpgplot.dll
pgplot/bin/pgplot.dll
pgplot/bin/grfont.dat
pgplot/include/cpgplot.h
pgplot/lib/cpgplot.a
pgplot/lib/pgplot.a
最后,再次尝试该示例给出以下结果;没有错误,但也没有图像...
Microsoft Windows [version 10.0.14393]
(c) 2016 Microsoft Corporation. Tous droits réservés.
C:\Windows\system32>perldl
perlDL shell v1.357
PDL comes with ABSOLUTELY NO WARRANTY. For details, see the file
'COPYING' in the PDL distribution. This is free software and you
are welcome to redistribute it under certain conditions, see
the same file for details.
ReadLines, NiceSlice, MultiLines enabled
Reading PDL/default.pdl...
Found docs database C:/Strawberry/perl/site/lib/PDL/pdldoc.db
Type 'help' for online help
Type 'demo' for online demos
Loaded PDL v2.017 (supports bad values)
Note: AutoLoader not enabled ('use PDL::AutoLoader' recommended)
pdl> use PDL
pdl> use PDL::Graphics::PGPLOT
pdl> imag(rvals(200,200)+1)
%PGPLOT, Unable to read font file: grfont.dat
%PGPLOT, Use environment variable PGPLOT_FONT to specify the location of the PGPLOT grfont.dat file.
Displaying 200 x 200 image from 1 to 142.421356201172, using 240 colors (16-255)...
pdl> $ENV{PGPLOT_FONT} = "C:/Strawberry/perl/site/lib/PGPLOT/pgplot_supp"
pdl> imag(rvals(200,200)+1)
Displaying 200 x 200 image from 1 to 142.421356201172, using 240 colors (16-255)...
pdl>