我目前在 Windows 系统上安装 Perl 时遇到困难,我需要处理特定 LaTeX 相关软件包。到目前为止,我的经历让我遇到了一系列问题,我正在寻求有效解决这些问题的指导。
最初,我尝试安装草莓Perl使用 Chocolatey,因为它通常推荐给 LaTeX 用户。但是,我遇到了一个与File::Which
依赖项相关的持续问题,我无法解决
Fetching http://www.cpan.org/authors/id/R/RE/REHSACK/File-HomeDir-1.006.tar.gz ... OK
Configuring File-HomeDir-1.006 ... OK
==> Found dependencies: File::Which
--> Working on File::Which
Fetching http://www.cpan.org/authors/id/P/PL/PLICEASE/File-Which-1.27.tar.gz ... OK
! Bad archive: File-Which-1.27.tar.gz
! Failed to unpack File-Which-1.27.tar.gz: no directory
! Failed to fetch distribution File-Which-1.27
! Installing the dependencies failed: Module 'File::Which' is not installed
! Bailing out the installation for File-HomeDir-1.006.
安装过程中的具体错误与获取和解压失败有关File::Which
。尽管我尝试了几次,包括更改 CPAN 镜像和手动安装依赖项,但我还是无法解决这个问题。
接下来,我开始尝试活动Perl来自 ActiveState 平台。不幸的是,这导致了一系列问题。安装过程中途失败,尽管我使用 Chocolatey 进行安装
WARNING: Generic MSI Error. This is a local environment error, not an issue with a package or the MSI itself - it could mean a pending reboot is necessary prior to install or something else (like the same version is already installed). Please see MSI log if available. If not, try again adding '--install-arguments="'/l*v c:\ActivePerl_msi_install.log'"'. Then search the MSI Log for "Return Value 3" and look above that for the error.
ERROR: Running ["C:\Windows\System32\msiexec.exe" /i "C:\Users\FooBar\AppData\Local\Temp\chocolatey\ActivePerl\5.28.0\ActivePerl-5.28.msi" /quiet TARGETDIR="C:\" PERL_PATH=Yes PERL_EXT=Yes ] was not successful. Exit code was '1603'. Exit code indicates the following: Generic MSI Error. This is a local environment error, not an issue with a package or the MSI itself - it could mean a pending reboot is necessary prior to install or something else (like the same version is already installed). Please see MSI log if available. If not, try again adding '--install-arguments="'/l*v c:\ActivePerl_msi_install.log'"'. Then search the MSI Log for "Return Value 3" and look above that for the error..
Environment Vars (like PATH) have changed. Close/reopen your shell to
see the changes (or in powershell/cmd.exe just type `refreshenv`).
The install of ActivePerl was NOT successful.
Error while running 'C:\ProgramData\chocolatey\lib\ActivePerl\tools\ChocolateyInstall.ps1'.
See log for details.
Chocolatey installed 0/1 packages. 1 packages failed.
See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
Failures
- ActivePerl (exited 1603) - Error while running 'C:\ProgramData\chocolatey\lib\ActivePerl\tools\ChocolateyInstall.ps1'.
See log for details.
这导致各种state.exe
文件分散在我的系统中的不同目录中(AppData\Local
和AppData\Roaming
)。事实证明,这些文件很难删除,并且会出现“拒绝访问”错误,这进一步复杂化了情况。
此时,我正在寻求有关以下方面的建议:
- 成功在 Windows 上安装 Perl 以用于 LaTeX 工作,特别是针对需要的包
latexindent
。 - 解决 StrawberryPerl 遇到的依赖问题,或者,
- 完成 ActivePerl 的安装,没有错误和后续文件污染。
我希望通过解决问题的错误部分来避免陷入 XY 问题。我的主要目标是拥有一个可以用于latexindent
LaTeX 项目的 Perl 设置。任何关于如何应对这种情况的见解、经验或建议都将不胜感激。
答案1
多年前我也遇到过这个问题,后来就放弃了。你的问题让我想起了这个问题,我设法让它工作了。
- 我正在使用 Miktex 发行版。
- 我刚刚使用从他们的网站下载的 MSI 安装了 StrawberryPerl。
我使用终端进行了测试
latexindent test.tex -w
这对我很有用。