How to install portia, a python application from Github (Mac)-open source projects scrapinghub/portia

down4keeps

I don’t have the rep to upvote Alagappan’s answer but he’s correct. Also, if you’re as inexperienced as I am, you may need further clarity on this.

You have to create, activate and navigate into the virtualenv before installing anything (including cloning portia from github). Here’s the whole thing working from start to finish:

1: cd to wherever you’d like to store your project… and Install virtualenv:

$ pip install virtualenv

2: Create the virtual environment. (I called mine “portia” but this can be anything.):

$ virtualenv portia

3: Activate the virtual environment you created (change the path to reflect the name you used here if not “portia”.):

$ source portia/bin/activate

At this point your terminal should have display the virtualenv name in parenthesis before the standard directory path prompt:(name-of-virtualenv) [your-machine]:[current-directory]: [user]$ …and if you list the files within your pwd you’ll see the name of you virtualenv there.

4: cd into your virtualenv (“portia” for me):

$ cd portia

5: Now you can clone portia from github into your virtualenv…

$ git clone https://github.com/scrapinghub/portia

6: cd into the cloned portia/slyd…

$ cd portia/slyd

7/8: pip install twisted and Scrapy…

$ pip install twisted
$ pip install Scrapy

You’re virtualenv should still be activated and you should still be in [virtualenv-name]/portia/slyd

9: Install the requirements.txt:

$ pip install -r requirements.txt

10: Run slyd:

$ twistd -n slyd

— No more scrapy error! —