Install Scrapy on OSX Lion

So, I'm trying to install Scrapy on Lion and am not sure if it is installed correctly or not.

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

Then I tried to take the first step to create a training project here,

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

But when I try to run,

scrapy startproject tutorial 

This does not work. I get...

$ python scrapy /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: cannot open file 'scrapy': [Errno 2] There is no such file or directory

Any idea why I get this error?

+4
source share
1 answer

Well, it seems like this is a problem of the way.

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

 sudo /usr/bin/easy_install scrapy 

The resulting scrapy command scrapy then installed in /usr/local/bin/scrapy .

You may not have this directory in your path, so see if this matches true:

 echo $PATH 

If it is not there, you can temporarily add it as export PATH=/usr/local/bin:$PATH or change your ~/.bash_profile to add it permanently.


As an alternative, I usually don’t use the installed Python system on Mac - I install homebrew and install a separate version of Python and install scrapy with this version ( scrapy then installed in /usr/local/share/python/scrapy ).

+15
source

Source: https://habr.com/ru/post/1411196/


All Articles