简体   繁体   English

在Python库中打包非Python文件

[英]Packaging Non-Python Files in a Python Library

I'm trying to build a Python package for this project that includes the .json files in /fixtures and the *.html files in /templates. 我正在尝试为这个项目构建一个Python包,其中包括/ fixtures中的.json文件和/ templates中的* .html文件。 When I run the packaging script based off my setup.py , it says it should include those folders in the MANIFEST it generates, but the output just says it's hard-linking them and when I try to install via pip, it dies on the following: 当我根据我的setup.py运行打包脚本时,它说它应该在它生成的MANIFEST中包含那些文件夹,但输出只是说它很难链接它们,当我尝试通过pip安装时,它会死于以下:

Downloading/unpacking bluetrain
  Running setup.py egg_info for package bluetrain
    error: package directory 'bluetrain/fixtures' does not exist
    Complete output from command python setup.py egg_info:
    running egg_info

writing pip-egg-info/bluetrain.egg-info/PKG-INFO
writing top-level names to pip-egg-info/bluetrain.egg-info/top_level.txt
writing dependency_links to pip-egg-info/bluetrain.egg-info/dependency_links.txt
warning: manifest_maker: standard file '-c' not found
error: package directory 'bluetrain/fixtures' does not exist

EDIT: It looks like this was an issue with legacy crud that built up in the virtualenv I was installing succeeding versions of the package into. 编辑:看起来这是遗留问题的一个问题,在virtualenv中构建我正在安装包的后续版本。 Trying a clean virtualenv fixed the issue. 尝试干净的virtualenv解决了这个问题。

Fixed this issue by creating a clean virtualenv and trying to build from there. 通过创建一个干净的virtualenv并尝试从那里构建来解决这个问题。 It appears the constant build/ rebuild cycle in the original environment left legacy files behind that were stopping things from working as intended. 看起来原始环境中的持续构建/重建周期留下了遗留文件,这些文件阻止了工作按预期工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM