python distutils不包含data

编程入门 行业动态 更新时间:2024-10-27 00:27:46
本文介绍了python distutils不包含data_files的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我是distutils的新手。.我试图在软件包中包括一些数据文件。.这是我的代码。

I am new to distutils.. I am trying to include few data files along with the package.. here is my code..

from distutils.core import setup setup(name='Scrapper', version='1.0', description='Scrapper', packages=['app', 'db', 'model', 'util'], data_files=[('app', ['app/scrapper.db'])] )

执行 python setup.py sdist 不包括scrapper.db文件。我在app目录中有scrapper.db文件。

The zip file created after executing python setup.py sdist does not include the scrapper.db file. I have scrapper.db file in the app directory..

感谢帮助。

推荐答案

您可能需要添加一个 MANIFEST.in 文件,其中包含 include app / scrapper.db 。

You probably need to add a MANIFEST.in file containing "include app/scrapper.db".

这是distutils中的一个错误,使得有必要: data_files 或 package_data 应该自动包含在生成的 MANIFEST 中。但是在Python 2.6和更早版本中则不是,因此您必须将其包含在 MANIFEST.in 中。

It's a bug in distutils that makes this necessary: anything in data_files or package_data should be included in the generated MANIFEST automatically. But in Python 2.6 and earlier, it is not, so you have to include it in MANIFEST.in.

该错误已在Python 2.7中修复。

The bug is fixed in Python 2.7.

更多推荐

python distutils不包含data

本文发布于:2023-07-05 15:52:42,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1039121.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:不包含   python   distutils   data

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!