Start a new topic
Answered

Deploying booksbot or quotesbot demo on macOS High Sierra

I haven't installed or even tried Python before, but I still want to try to write and deploy my own code rather than going the Portia route, for the sake of curiousity and learning. I'm sure I'm not the only one with this use case. I'm using macOS High Sierra, which comes with a Python 2 version preinstalled.


This is what happens when I try to follow Scrapinghub's instructions for installing one of the demos, trying to troubleshoot the errors that I get after googling Stack Overflow. I'm really not sure what I'm doing, though. What should I have done instead of the below steps to make everything work? It doesn't feel right to get error after error like this. I'm attaching the complete log from Terminal as a text file.


$ pip install shub

-bash: pip: command not found


$ sudo easy_install pip

[…]

Installed /Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg

Processing dependencies for pip

Finished processing dependencies for pip


$ pip install shub

[…]

OSError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/tqdm-4.19.5.dist-info'


$ sudo pip install shub

[…]

OSError: [Errno 1] Operation not permitted: '/System/Library/Frameworks/Python.framework/Versions/2.7/man'


[here I download python3 from https://www.python.org/downloads/ and install it by double-clicking the installer]


$ sudo pip install shub

[…]

OSError: [Errno 1] Operation not permitted: '/tmp/pip-gxz2Rw-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six-1.4.1-py2.7.egg-info'


[here I download get-pip.py from https://pip.pypa.io/en/latest/installing/ to to ~/Downloads]


$ sudo python3 ~/Downloads/get-pip.py

[…]

Successfully installed wheel-0.30.0


$ sudo pip install shub

[…]

OSError: [Errno 1] Operation not permitted: '/tmp/pip-gxz2Rw-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six-1.4.1-py2.7.egg-info'


$ pip install shub

[…]

OSError: [Errno 1] Operation not permitted: '/var/folders/_4/jdfdlxn96t5brn4r08x1y7040000gn/T/pip-gnkse8-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six-1.4.1-py2.7.egg-info'


$ pip3 install shub

[…]

Successfully installed PyYAML-3.12 certifi-2018.1.18 chardet-3.0.4 click-6.7 docker-py-1.10.6 docker-pycreds-0.2.2 idna-2.6 requests-2.18.4 retrying-1.3.3 scrapinghub-2.0.3 shub-2.7.0 six-1.11.0 tqdm-4.19.5 urllib3-1.22 websocket-client-0.46.0


$ git clone https://github.com/scrapy/booksbot.git

[…]

Unpacking objects: 100% (24/24), done.


$ cd booksbot


booksbot $ shub login

-bash: shub: command not found

txt
(38.6 KB)

Best Answer

Might need to add the python directory to your PATH or if not try brew install python and then pip install shub or sudo pip install shub


Answer

Might need to add the python directory to your PATH or if not try brew install python and then pip install shub or sudo pip install shub


1 person likes this

That's it!


$ export PATH=/usr/local/bin:$PATH

$ shub login

[…]

Enter your API key from https://app.scrapinghub.com/account/apikey


Thank you!

Login to post a comment