Scrapy installation on OSX Lion

被刻印的时光 ゝ 提交于 2019-12-04 03:35:13

问题


So I'm trying to install Scrapy on Lion and am not sure if it's properly installed or not.

I followed the guide here http://doc.scrapy.org/en/latest/intro/install.html#intro-install

Then tried to do the first step to create a tutorial project here,

http://doc.scrapy.org/en/latest/intro/tutorial.html

But when I try to run,

scrapy startproject tutorial

It doesn't work. I get...

$ python scrapy /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: can't open file 'scrapy': [Errno 2] No such file or directory

Any idea why I get such an error?


回答1:


Well turns out it's likely a path issue.

On my Mac, I used easy_install from /usr/bin.

sudo /usr/bin/easy_install scrapy

The resulting scrapy command is then installed into /usr/local/bin/scrapy.

You might not have that directory in your path, so see if that's true with:

echo $PATH

If it isn't in there, you can temporarily add it like export PATH=/usr/local/bin:$PATH, or modify your ~/.bash_profile to add it permanently.


Alternatively, I typically don't use the system installed Python in Mac - I install homebrew and install a separate version of Python, and install scrapy with that version (scrapy is then installed into /usr/local/share/python/scrapy).



来源:https://stackoverflow.com/questions/10490303/scrapy-installation-on-osx-lion

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!