Installation

Portia is a powerful tool, and it depends on multiple external libraries for its functionality. It is also relatively new, so currently, the installation steps are somewhat involved. In case the installation is simplified in future, the latest documentation can be found at https://github.com/scrapinghub/portia#running-portia. The current recommended way to run Portia is to use Docker (the open-source container framework). If you don't have Docker installed, you'll need to do so first by following the latest instructions (https://docs.docker.com/engine/installation/).

Once Docker is installed and running, you can pull the scrapinghub image and get started. First, you should be in the directory you'd like to create your new portia project and run the command like so:

$ docker run -v ~/portia_projects:/app/data/projects:rw -p 9001:9001 scrapinghub/portia:portia-2.0.7
Unable to find image 'scrapinghub/portia:portia-2.0.7' locally
latest: Pulling from scrapinghub/portia
...
2017-03-28 12:57:42.711720 [-] Site starting on 9002
2017-03-28 12:57:42.711818 [-] Starting factory <slyd.server.Site instance at 0x7f57334e61b8>
In the command, we created a new folder at ~/portia_projects. If you'd rather have your portia projects stored elsewhere, change the -v command to point to the absolute file path where you would like to store your portia files.

These last few lines show that the Portia website is now up and running. The site will now be accessible in your web browser at http://localhost:9001/.

Your initial screen should look similar to this:

If you have problems during installation it's worth checking the Portia Issues page at https://github.com/scrapinghub/portia/issues, in case someone else has experienced the same problem and found a solution. In this book I have used the specific Portia image I used (scrapinghub/portia:portia-2.0.7), but you can also try using the latest official release scrapinghub/portia.

In addition, I recommend always using the latest recommended instructions as documented in the README file and Portia documentation, even if they differ from the ones covered in this section. Portia is under active development and instructions could change after the publication of this book. 

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset