---
title: "python 源码打包data_files参数失效(备忘)"
author: "iyuan"
date: "2014-11-10T18:03:32Z"
tags: []
categories: ["编程语言"]
slug: "python-data-files"
draft: false
lastmod: "2014-11-10T18:13:21Z"
id: 2154256
url: "https://iyuan.iteye.com/blog/2154256"
---

由于打包一个Django app 需要将一些html也放入包中，发现data_files参数没有生效，

查了一下（详见：<http://stackoverflow.com/questions/2994396/python-distutils-does-not-include-data-files>）

需要增补一个文件: MANIFEST.in, 据说这是个bug,2.7+就已经修复，不过我的环境就是2.7.3,

暂未细究，留此备忘，如有知情者烦请不吝赐教～

BTW, 增补了MANIFEST.in文件后，data_files参数都不用填了,不过需要添加参数include_package_data=True.

[MANIFEST.in 参数规则]('https://docs.python.org/2/distutils/sourcedist.html')