4

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?

Facundo Casco
  • 10,065
  • 8
  • 42
  • 63
  • What does `which scrapy` return on the command line? – wkl May 07 '12 at 23:17
  • Empty response, going to try to build and install manually to see what happens...*EDIT* installed manually, still same response. which scrapy results in an empty response. –  May 07 '12 at 23:24
  • No response means `scrapy` is not in your path - I'll respond when I get home and get on my Macbook, as I forget what the regular path is for most of the python add-ons. – wkl May 07 '12 at 23:35
  • I tried locally with `sudo /usr/bin/easy_install scrapy`, and it put `scrapy` into `/usr/local/bin/scrapy`. – wkl May 08 '12 at 01:34
  • @birryree if you want to put that as an answer so you will get credit please do :) worked for me! –  May 08 '12 at 16:24

1 Answers1

16

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).

wkl
  • 77,184
  • 16
  • 165
  • 176