使用shub部署将需求错误部署到scrapy云

时间:2017-05-21 22:19:57

标签: python scrapy

我在3天前部署了一个项目,shub部署运行完美。我刚刚尝试再次部署相同的代码,它显示了这样的需求错误:

 Packing version c1f72fb-master
 Deploying to Scrapy Cloud project "187201"
 Deploy log last 30 lines:
 ---> 72b41733c189
 Step 9 : RUN mkdir /app/python && chown nobody:nogroup /app/python
 ---> Using cache
 ---> dda1555878eb
 Step 10 : RUN sudo -u nobody -E PYTHONUSERBASE=$PYTHONUSERBASE pip install 
 --user --no-cache-dir -r /app/requirements.txt
 ---> Using cache
 ---> cccdde466280
 Step 11 : COPY *.egg /app/
 ---> afc6b3540c92
 Removing intermediate container bd3bedcee848
 Step 12 : RUN if [ -d "/app/addons_eggs" ]; then rm -f /app/*.dash-
 addon.egg; fi
 ---> Running in 80461e4402dc
 ---> 830db9615167
 Removing intermediate container 80461e4402dc
 Step 13 : ENV PATH 
 /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
 ---> Running in 9af6ab0fdc02
 ---> 0f33ba992cc7
 Removing intermediate container 9af6ab0fdc02
 Successfully built 0f33ba992cc7
 >>> Checking python dependencies
 WARNING: There're some errors when doing pip-check:
 Traceback (most recent call last):
 File "/usr/local/bin/pip", line 4, in <module>
 import re
 File "/usr/local/lib/python3.6/re.py", line 142, in <module>
 class RegexFlag(enum.IntFlag):
 AttributeError: module 'enum' has no attribute 'IntFlag'
 {"message": "Dependencies check exit code: 1", "details": "Pip checks 
 failed, please fix the conflicts", "error": "requirements_error"}

 {"status": "error", "message": "Requirements error"}
  Deploy log location: 
  c:\users\sim04\appdata\local\temp\shub_deploy__oqwt2.log
 Error: Deploy failed: {"status": "error", "message": "Requirements error"}

1 个答案:

答案 0 :(得分:0)

确保按照以下步骤正确指定所需的模块。

在项目的主文件夹中创建一个名为scrapinghub.yml的文件,其中包含以下内容。

projects:
  default: 111149
requirements:
  file: requirements.txt

111149是我在scrapinghub上的proejct ID。

在同一目录中创建另一个名为requirements.txt的文件。

并将所需的模块与您在该文件中使用的版本号一起放置,如下所示,

MySQL-python==1.2.5

PS:我使用的是MySQLDB模块,所以我把它放了。