我想执行以下命令...
scrapy startproject resultScrapper
但是,出现以下错误......
-bash: /Users/usrname/Library/Enthought/Canopy_64bit/User/bin/scrapy: /Users/usrname/Library/Enthought/Canopy_32bit/User/bin/python: bad interpreter: No such file or directory
哪个scrapy
/Users/usrname/Library/Enthought/Canopy_64bit/User/bin/scrapy
这是$ PATH
echo $PATH
/Users/usrname/Library/Enthought/Canopy_64bit/User/bin:/Users/usrname/Library/Enthought/Canopy_64bit/System/bin:/Users/usrname/Library/Enthought/Canopy_64bit/User/bin:/Library/Frameworks/Python.framework/Versions/Current/bin:/usr/bin
我删除了Canopy_32bit版本......它是如何被引用的? $ PATH也不包含指向它的链接。
答案 0 :(得分:1)
我怀疑解释器在scrapy
脚本的shebang行中设置不正确。
如果输出
head -n1 /Users/usrname/Library/Enthought/Canopy_64bit/User/bin/scrapy
是
#! /Users/usrname/Library/Enthought/Canopy_32bit/User/bin/python
然后你应该把它改成
#! /usr/bin/env python
(更便携,但可能无法调用你想要的python)或
#! /Users/usrname/Library/Enthought/Canopy_64bit/User/bin/python
(不太便携,但强制64位Enthought python;假设路径对你的系统是正确的)
更有趣的是,64位安装将链接到32位解释器。有许多可能的解释,但我担心的是,有一些依赖不会对64位有效。对于纯python(根据网站,Scrapy是),这应该不是问题。