Scrapyd-deploy 命令没有从 git 个子模块中获取文件

Scrapyd-deploy command didn't take file from git submodules

各位。我有 issues.Here 是我的项目结构:

+-- scraper  
|  +-- scraper  
|    +-- classification  
|    |  +-- classifier.py  
|    |  +-- .gitignore  
|    +-- helpers  
|    |  +-- help1.py  
|    +-- spiders  
|    |  +-- spider1.py
.gitignore
.gitmodule
scrapy.cfg

当我 运行 命令 scrapyd-deploy scraper -p scraper - 我还没有部署目录 classification 这是 git 尚未部署的子模块。我做错了什么?

您的树似乎缺少 __init__.py 个文件。没有这些文件,scrapyd 将无法识别包。
所有 python 包都需要在其根目录中包含 __init__.py。所以你的树应该看起来更像:

+-- scraper  
|  +-- scraper  
|    +-- __init__.py    <---
|    +-- classification  
|    |  +-- __init__.py    <---
|    |  +-- classifier.py  
|    |  +-- .gitignore  
|    +-- helpers  
|    |  +-- __init__.py    <---
|    |  +-- help1.py  
|    +-- spiders  
|    |  +-- __init__.py    <---
|    |  +-- spider1.py
|.gitignore
|.gitmodule
|scrapy.cfg
|setup.py   <---

并且可能还有一个 setup.py 文件用于设置说明。