0
我haved上Python 3.5.2
安裝scrapy,但是當我在命令行exeute scrapy -v
,它發生:導入錯誤:沒有名爲模塊「twisted.persisted」
>> scrapy -v
Traceback (most recent call last):
File "/usr/bin/scrapy", line 7, in <module>
from scrapy.cmdline import execute
File "/usr/local/python3.5.2/lib/python3.5/site-packages/scrapy/__init__.py", line 27, in <module>
from . import _monkeypatches
File "/usr/local/python3.5.2/lib/python3.5/site-packages/scrapy/_monkeypatches.py", line 20, in <module>
import twisted.persisted.styles # NOQA
ImportError: No module named 'twisted.persisted'
所以我進入ipython3,以確保無論是porperly安裝:
In [2]: import twisted
In [3]: twisted.version
Out[3]: Version('twisted', 15, 2, 1)
但是,當我import scrapy
,同樣作爲命令行:
In [4]: import scrapy
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-4-51c73a18167b> in <module>()
----> 1 import scrapy
/usr/local/python3.5.2/lib/python3.5/site-packages/scrapy/__init__.py in <module>()
25
26 # Apply monkey patches to fix issues in external libraries
---> 27 from . import _monkeypatches
28 del _monkeypatches
29
/usr/local/python3.5.2/lib/python3.5/site-packages/scrapy/_monkeypatches.py in <module>()
18 # Undo what Twisted's perspective broker adds to pickle register
19 # to prevent bugs like Twisted#7989 while serializing requests
---> 20 import twisted.persisted.styles # NOQA
21 # Remove only entries with twisted serializers for non-twisted types.
22 for k, v in frozenset(copyreg.dispatch_table.items()):
ImportError: No module named 'twisted.persisted'
我很困惑,我只想運行一個spaider,所以幫助我!
您也可以通過輸入'pip show來檢查包版本和其他包信息' –
Granitosaurus