Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scrapy not installed correctly on mac?

I have tried to install Scrapy on mac 10.8.2. Here's what I did:

In terminal, I ran the command from with myuser directory:

pip install --user scrapy

I got the following message in Terminal:

Successfully installed scrapy
Cleaning up...

Next I do the following from the same myuser dir:

scrapy shell http://example.com

Here's the error I am getting:

-bash: scrapy: command not found

I believe this is a path issue, scrapy has been installed in /Library/Python/2.7/lib/python/site-packages. How do I get scrapy to run?

like image 388
user818190 Avatar asked Mar 24 '23 05:03

user818190


1 Answers

--user option is used when you want to install a package into the local user's $HOME, e.g. on Mac it should be $HOME/Library/Python/2.7/lib/python/site-packages.

scrapy executable could be found at $HOME/Library/Python/2.7/bin/scrapy. So, you should edit your .bash_login file and modify PATH env variable:

PATH="$HOME/Library/Python/2.7/bin/:$PATH"

Or, just reinstall scrapy without --user flag.

Hope that helps.

like image 125
alecxe Avatar answered Apr 06 '23 18:04

alecxe