Python 使用setuptools创建deb或rpm–;数据文件

Python 使用setuptools创建deb或rpm–;数据文件,python,python-3.x,rpm,setuptools,deb,Python,Python 3.x,Rpm,Setuptools,Deb,我有一个Python3项目 MKC ├── latex │ ├── macros.tex │ └── main.tex ├── mkc │ ├── cache.py │ ├── __init__.py │ └── __main__.py ├── README.md ├── setup.py └── stdeb.cfg 安装时,我想将我的latex文件移动到已知目录,例如/usr/share/mkc/latex,因此我告诉setuptools包含数据文件 data_files

我有一个Python3项目

MKC
├── latex
│   ├── macros.tex
│   └── main.tex
├── mkc
│   ├── cache.py
│   ├── __init__.py
│   └── __main__.py
├── README.md
├── setup.py
└── stdeb.cfg
安装时,我想将我的latex文件移动到已知目录,例如
/usr/share/mkc/latex
,因此我告诉
setuptools
包含数据文件

data_files=[("/usr/share/mkc/latex",
             ["latex/macros.tex", "latex/main.tex"])],
现在当我跑的时候

./setup.py bdist --formats=rpm

我得到以下错误:

error: can't copy 'latex/macros.tex': doesn't exist or not a regular file 错误:无法复制“latex/macros.tex”:不存在或不是常规文件 只要运行
/setup.py bdist
就可以了,所以问题一定出在包的创建上。

当创建一个deb文件时(我猜对rpm文件来说也是这样),
/setup.py--command packages=stdeb.command bdist_deb
首先创建一个源发行版并使用该归档进行进一步处理。但是你的LaTeX文件不在这里,所以找不到

您需要将它们添加到源程序包中。可通过添加包含以下内容的

recursive-include latex *.tex

从3.1版开始,将自动在源代码分发版中包含
数据\u文件
,但工作方式显然非常不同。

您是否在某个地方在线存储了该文件;也许是开着?它在起作用,我想我知道为什么。赏金是你的!
recursive-include latex *.tex