gpt4 book ai didi

Python Enthought 32 与 64 位版本

转载 作者:行者123 更新时间:2023-11-28 18:48:48 24 4
gpt4 key购买 nike

我要执行以下命令...

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

哪个有问题

/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 也不包含指向它的链接。

最佳答案

我怀疑解释器在 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 是),这应该不是问题。

关于Python Enthought 32 与 64 位版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16270694/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com