我已经使用Scrapy网站提供的Ubuntu软件包安装了Scrapy.但是在开始Scrapy项目时
scrapy startproject test
Run Code Online (Sandbox Code Playgroud)
我收到错误消息.
Traceback (most recent call last): File "/usr/bin/scrapy", line 5,
in <module>
from pkg_resources import load_entry_point File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 3084,
in <module>
File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 3070, in _call_aside
File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 3097, in _initialize_master_working_set
File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 653, in _build_master
File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 666, in _build_from_requirements
File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 844, in resolve
pkg_resources.ContextualVersionConflict: (pyasn1 0.1.7 (/usr/lib/python2.7/dist-packages),
Requirement.parse('pyasn1>=0.1.8'), set(['pyasn1-modules']))
Run Code Online (Sandbox Code Playgroud)
请帮我解决这个错误.我正在运行Python 2.7.6
输入:
l1 = ['a', '', '', '']
l2 = ['', 'b', '', '']
l3 = ['', '', 'c', '']
l4 = ['', '', '', 'd']
Run Code Online (Sandbox Code Playgroud)
预期产量:
['a', 'b', 'c', 'd']
Run Code Online (Sandbox Code Playgroud)
我试过了
list(map(str.__add__, l1, l2, l3, l4))
看起来str.__add__
不接受两个以上的列表对象.
任何解决方法?
编辑:基于Jim Fasarakis-Hilliard的评论.
l1 = ['a', '1', '', '']
l2 = ['', 'b', '2', '']
l3 = ['', '', 'c', '']
l4 = ['', '', '', 'd']
Run Code Online (Sandbox Code Playgroud)
预期产量:
['a', '1b', '2c', 'd']
Run Code Online (Sandbox Code Playgroud)
谢谢