1

我准备好了我的蜘蛛,现在我想将它们部署到 scrapinghub。我已经成功安装了 shub running pip3 install shub。我使用python 3.7。

但是当我运行 shub 时,我得到一个语法错误。我可以看到这个问题应该在最新的 shub 版本 2.8 中修复。我做错了什么,还是错误仍未修复?你可以在这里看到错误https://github.com/scrapinghub/shub/pull/327 错误看起来像这样

shub
Traceback (most recent call last):
File "/usr/local/bin/shub", line 7, in <module>
from shub.tool import cli
File "/usr/local/lib/python3.7/site-packages/shub/tool.py", line 57, in 
<module>
command_module = importlib.import_module(module_path)
File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "/usr/local/lib/python3.7/site-packages/shub/deploy.py", line 27, in <module>
from shub.image.upload import upload_cmd
File "/usr/local/lib/python3.7/site-packages/shub/image/__init__.py", line 23, in <module>
command_module = importlib.import_module(module_path)
File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "/usr/local/lib/python3.7/site-packages/shub/image/deploy.py", line 61
apikey, insecure, async):
                      ^
SyntaxError: invalid syntax
4

1 回答 1

1

也许您安装了缓存版本?你试过了吗:

pip install -U shub

?

更新:该修复包含在 2.8.1 中

于 2018-08-14T18:53:19.447 回答