2

我正在尝试ffvideo为 conda 打包模块。它是一个链接到 ffmpeg 的 Cython 模块。我能够构建配方(因此链接在编译时有效),但是我无法在新环境中安装生成的包。原因是在执行时包找不到它在编译时链接到的 dll(它们的路径现在不同,因为它们处于不同的环境中)。

我尝试binary_has_prefix_files在我指向的 conda 配方中使用标志Lib\site-packages\ffvideo.pyd。但是,它似乎没有帮助。

有没有办法将 Cython 包链接到相对路径或类似的东西?

目前的食谱是:

package:
name: ffvideo
version: 0.0.13

source:
fn: b45143f755ac.zip
url: https://bitbucket.org/groakat/ffvideo/get/b45143f755ac.zip
#  md5: cf42c695fab68116af2c8ef816fca0d9

build:                   [win]
number: 3              [win]
binary_has_prefix_files:
    - Lib\site-packages\ffvideo.pyd

requirements:
build:
    - python
    - cython             [win]
    - mingw                              [win]
    - ffmpeg-dev         [win]  
    - mingw
    - pywin32
    - setuptools
    - libpython

run:
    - python
    - ffmpeg-dev         [win]
    - cython
    - mingw
    - pywin32
    - setuptools
    - libpython


about:
home: https://bitbucket.org/groakat/ffvideo/
license: Standard PIL license

该软件包位于 binstar https://binstar.org/groakat/ffvideo/files上。依赖项都在我的频道https://binstar.org/groakat/

又一想。ffvideo取决于我ffmpeg-dev还打包了哪个,可能是我也需要在那里使用该binary_has_prefix_files选项吗?

4

1 回答 1

1

To quote Travis Oliphant's answer from the conda mailing list:

On Windows, our current recommended approach is to:

1) put the DLLS next to the executable that needs them
2) put the DLLS in a directory that is on your PATH environment variable. 

By default, Anaconda and Miniconda add two directories to the path (the root directory and %ROOT% / Scripts). You could either put the dlls in that directory or add the directory the dlls are located to your PATH.

于 2014-09-04T18:20:05.427 回答