Windows 7上的Haskell平台2010.2.0.0上的Cabal安装错误丢失

2024-09-24 04:24:20 发布

您现在位置:Python中文网/ 问答频道 /正文

我是一个新手Haskell用户,希望使用Python库(用于与现有软件的交互,例如使用Numpy库)。我发现这可以使用MissingPy包(http://hackage.haskell.org/package/MissingPy)来完成,但是我无法通过cabal在Haskell平台2010.2.0.0的windows7上安装它。在

我遇到的第一个错误是因为编译器没有找到python2.6库。通过将python2.6.dll放在正确的目录中(或将其添加到系统路径变量中)来解决此问题。但是,我无法修复“cabal install missingpy”命令输出结尾处的以下错误:

...
[11 of 12] Compiling MissingPy.FileArchive.GZip ( MissingPy\FileArchive\GZip.hs, dist\build\MissingPy\FileArchive\GZip.p_o )
[12 of 12] Compiling MissingPy.FileArchive.BZip2 ( MissingPy\FileArchive\BZip2.hs, dist\build\MissingPy\FileArchive\BZip2.p_o )
Registering MissingPy-0.10.5...
setup.exe: MissingPy-0.10.5: library-dirs: None doesn't exist or isn't a
directory (use --force to override)
cabal: Error: some packages failed to install:
MissingPy-0.10.5 failed during the building phase. The exception was:
ExitFailure 1

我在阅读了关于Using c2hs on Windows上问题答案的建议后安装了完整的MinGW软件。然而,这并没有解决问题。在

有没有人在这个问题上有经验和解决办法?在


Tags: installoftobuild软件haskelldist错误
1条回答
网友
1楼 · 发布于 2024-09-24 04:24:20

注意安装程序.exe使用python工具填充构建信息:

https://github.com/softmechanics/missingpy/blob/master/Setup.hs

相关代码如下:

  libDir       <- python ["-c", "from distutils.sysconfig import *; print get_python_lib()"]
  incDir       <- python ["-c", "from distutils.sysconfig import *; print get_python_inc()"]
  confLibDir   <- python ["-c", "from distutils.sysconfig import *; print get_config_var('LIBDIR')"]
  pyVersionStr <- python ["-c", "import sys; sys.stdout.write(\"%d.%d\" % (sys.version_info[0], sys.version_info[1]))"]

如果python工具不存在、无法找到或提供错误信息,安装程序将失败。在

相关问题 更多 >