2017-07-31 58 views
0

everyone。我有issues.Here是我的項目結構:Scrapyd-deploy命令沒有從git submodules中獲取文件

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

當我運行命令scrapyd-deploy scraper -p scraper - 我還沒有部署DIR classification這是一個尚未部署git的子模塊。我做錯了什麼?

回答

2

你的樹看起來像是缺少__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文件的安裝說明,以及。

+0

換句話說,他沒有使用python包。 – Nabin

+0

非常感謝。它有幫助 – AndMar