2009-01-06 14:34:26 +00:00
|
|
|
.. _intro-install:
|
2009-01-06 00:15:55 +00:00
|
|
|
|
2009-04-10 05:35:53 +00:00
|
|
|
==================
|
|
|
|
Installation guide
|
|
|
|
==================
|
|
|
|
|
2010-11-17 21:32:23 -02:00
|
|
|
This document describes how to install Scrapy on Linux, Windows and Mac OS X.
|
2010-08-23 21:28:32 -03:00
|
|
|
|
2009-04-11 18:34:44 +00:00
|
|
|
.. _intro-install-requirements:
|
2009-01-06 14:34:26 +00:00
|
|
|
|
2008-12-16 14:58:52 +00:00
|
|
|
Requirements
|
|
|
|
============
|
|
|
|
|
2010-08-21 01:26:35 -03:00
|
|
|
* `Python`_ 2.5, 2.6, 2.7 (3.x is not yet supported)
|
2009-04-11 18:34:44 +00:00
|
|
|
|
2010-04-24 18:19:52 -03:00
|
|
|
* `Twisted`_ 2.5.0, 8.0 or above (Windows users: you'll need to install
|
|
|
|
`Zope.Interface`_ and maybe `pywin32`_ because of `this Twisted bug`_)
|
2009-04-10 11:01:56 +00:00
|
|
|
|
2010-11-17 21:32:23 -02:00
|
|
|
* `lxml`_ or `libxml2`_ (if using `libxml2`_, version 2.6.28 or above is highly recommended)
|
2009-04-10 11:01:56 +00:00
|
|
|
|
2010-11-16 03:31:04 -02:00
|
|
|
* `simplejson`_ (not required if using Python 2.6 or above)
|
|
|
|
|
2010-11-17 21:32:23 -02:00
|
|
|
* `pyopenssl <http://pyopenssl.sourceforge.net>`_ (for HTTPS support. Optional,
|
|
|
|
but highly recommended)
|
2008-12-16 14:58:52 +00:00
|
|
|
|
2010-11-17 21:32:23 -02:00
|
|
|
.. _intro-install-python:
|
2008-12-16 14:58:52 +00:00
|
|
|
|
2010-11-17 21:32:23 -02:00
|
|
|
Install Python
|
|
|
|
==============
|
2009-04-11 18:34:44 +00:00
|
|
|
|
2010-11-17 21:32:23 -02:00
|
|
|
First, you need to install Python, if you haven't done so already.
|
2008-12-16 14:58:52 +00:00
|
|
|
|
2010-11-17 21:32:23 -02:00
|
|
|
Scrapy works with Python 2.5, 2.6 or 2.7, which you can get at
|
|
|
|
http://www.python.org/download/
|
2008-12-16 14:58:52 +00:00
|
|
|
|
2010-11-17 21:32:23 -02:00
|
|
|
.. seealso:: :ref:`faq-python-versions`
|
2008-12-16 14:58:52 +00:00
|
|
|
|
2009-04-11 18:34:44 +00:00
|
|
|
.. highlight:: sh
|
|
|
|
|
2010-11-17 21:32:23 -02:00
|
|
|
.. _intro-install-scrapy:
|
2009-01-26 23:28:19 +00:00
|
|
|
|
2010-11-17 21:32:23 -02:00
|
|
|
Install Scrapy
|
|
|
|
==============
|
2009-04-11 18:34:44 +00:00
|
|
|
|
2010-11-17 21:32:23 -02:00
|
|
|
There are many ways to install Scrapy. Pick the one you feel more comfortable
|
|
|
|
with.
|
2009-01-26 23:28:19 +00:00
|
|
|
|
2010-11-17 21:32:23 -02:00
|
|
|
* :ref:`intro-install-release` (requires installing dependencies separately)
|
|
|
|
* :ref:`intro-install-easy` (automatically installs dependencies)
|
|
|
|
* :ref:`intro-install-pip` (automatically installs dependencies)
|
2009-09-29 09:44:02 -03:00
|
|
|
|
|
|
|
.. _intro-install-release:
|
|
|
|
|
2010-11-17 21:32:23 -02:00
|
|
|
Download and install an official release
|
|
|
|
----------------------------------------
|
2009-04-10 11:01:56 +00:00
|
|
|
|
2009-09-29 08:41:34 -03:00
|
|
|
Download Scrapy from the `Download page`_. Scrapy is distributed in two ways: a
|
|
|
|
source code tarball (for Unix and Mac OS X systems) and a Windows installer
|
2010-08-21 01:26:35 -03:00
|
|
|
(for Windows). If you downloaded the tarball, you can install it as any Python
|
2009-09-29 08:41:34 -03:00
|
|
|
package using ``setup.py``::
|
2009-04-10 11:01:56 +00:00
|
|
|
|
2010-11-17 21:32:23 -02:00
|
|
|
tar zxf Scrapy-X.X.X.tar.gz
|
|
|
|
cd Scrapy-X.X.X
|
2009-09-29 08:41:34 -03:00
|
|
|
python setup.py install
|
2009-05-19 01:50:44 -03:00
|
|
|
|
2009-09-29 08:41:34 -03:00
|
|
|
If you downloaded the Windows installer, just run it.
|
2008-12-16 15:40:27 +00:00
|
|
|
|
2009-09-29 08:41:34 -03:00
|
|
|
.. warning:: In Windows, you may need to add the ``C:\Python25\Scripts`` (or
|
2009-09-29 09:44:02 -03:00
|
|
|
``C:\Python26\Scripts``) folder to the system path by adding that directory
|
2009-09-29 08:41:34 -03:00
|
|
|
to the ``PATH`` environment variable from the `Control Panel`_.
|
2008-12-16 15:40:27 +00:00
|
|
|
|
2009-09-29 08:41:34 -03:00
|
|
|
.. _Download page: http://scrapy.org/download/
|
2008-12-16 15:40:27 +00:00
|
|
|
|
2009-09-29 09:44:02 -03:00
|
|
|
.. _intro-install-easy:
|
|
|
|
|
2010-11-17 21:32:23 -02:00
|
|
|
Installing with ``easy_install``
|
|
|
|
--------------------------------
|
2008-12-16 15:40:27 +00:00
|
|
|
|
2010-11-17 21:32:23 -02:00
|
|
|
You can install Scrapy using setuptools_'s ``easy_install`` with::
|
2009-09-29 08:41:34 -03:00
|
|
|
|
2010-11-17 21:32:23 -02:00
|
|
|
easy_install Scrapy
|
2008-12-16 15:40:27 +00:00
|
|
|
|
2010-11-17 21:32:23 -02:00
|
|
|
.. _intro-install-pip:
|
2009-03-22 22:05:23 +00:00
|
|
|
|
2010-11-17 21:32:23 -02:00
|
|
|
Installing with `pip`_
|
|
|
|
----------------------
|
2009-09-29 09:44:02 -03:00
|
|
|
|
2010-11-17 21:32:23 -02:00
|
|
|
You can install Scrapy using `pip`_ with::
|
2009-03-22 22:05:23 +00:00
|
|
|
|
2010-11-17 21:32:23 -02:00
|
|
|
pip install Scrapy
|
2009-03-22 22:05:23 +00:00
|
|
|
|
2010-11-17 21:32:23 -02:00
|
|
|
.. _intro-install-platforms:
|
2008-12-16 15:40:27 +00:00
|
|
|
|
2010-11-17 21:32:23 -02:00
|
|
|
Platform specific instructions
|
|
|
|
==============================
|
2008-12-16 15:40:27 +00:00
|
|
|
|
2010-11-17 21:32:23 -02:00
|
|
|
Linux
|
|
|
|
-----
|
2009-09-29 08:41:34 -03:00
|
|
|
|
2010-11-17 21:32:23 -02:00
|
|
|
Ubuntu 9.10 or above
|
|
|
|
~~~~~~~~~~~~~~~~~~~~
|
2009-09-29 08:41:34 -03:00
|
|
|
|
2010-11-17 21:32:23 -02:00
|
|
|
If you're running Ubuntu 9.10 (or above), use the official :ref:`Ubuntu
|
|
|
|
Packages <topics-ubuntu>`, which already solve all dependencies for you and are
|
|
|
|
continuously updated with the latest bug fixes.
|
2009-03-22 22:05:23 +00:00
|
|
|
|
2010-11-17 21:32:23 -02:00
|
|
|
Debian or Ubuntu (9.04 or older)
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
2009-04-10 11:01:56 +00:00
|
|
|
|
2010-11-17 21:32:23 -02:00
|
|
|
If you're running Debian Linux, run the following command as root::
|
2009-04-10 11:01:56 +00:00
|
|
|
|
2010-11-17 21:32:23 -02:00
|
|
|
apt-get install python-twisted python-libxml2 python-pyopenssl python-simplejson
|
2009-04-10 11:01:56 +00:00
|
|
|
|
2010-11-17 21:32:23 -02:00
|
|
|
And then follow the instructions in :ref:`intro-install-scrapy`.
|
2009-04-10 11:01:56 +00:00
|
|
|
|
2010-11-17 21:32:23 -02:00
|
|
|
Arch Linux
|
|
|
|
~~~~~~~~~~
|
2009-04-10 11:01:56 +00:00
|
|
|
|
2010-11-17 21:32:23 -02:00
|
|
|
If you are running Arch Linux, run the following command as root::
|
2009-04-10 11:01:56 +00:00
|
|
|
|
2010-11-17 21:32:23 -02:00
|
|
|
pacman -S twisted libxml2 pyopenssl python-simplejson
|
2009-04-10 11:01:56 +00:00
|
|
|
|
2010-11-17 21:32:23 -02:00
|
|
|
And then follow the instructions in :ref:`intro-install-scrapy`.
|
2009-04-10 11:01:56 +00:00
|
|
|
|
2010-11-17 21:32:23 -02:00
|
|
|
Other Linux distros
|
|
|
|
~~~~~~~~~~~~~~~~~~~
|
2009-04-10 11:01:56 +00:00
|
|
|
|
2010-11-17 21:32:23 -02:00
|
|
|
The easiest way to install Scrapy in other Linux distros is through
|
|
|
|
``easy_install``, which will automatically install Twisted and lxml as
|
|
|
|
dependencies. See :ref:`intro-install-easy`.
|
2009-04-10 11:01:56 +00:00
|
|
|
|
2010-11-17 21:32:23 -02:00
|
|
|
Another way would be to install dependencies, if you know the packages in your
|
|
|
|
distros that meets them. See :ref:`intro-install-requirements`.
|
2009-04-10 11:01:56 +00:00
|
|
|
|
2010-11-17 21:32:23 -02:00
|
|
|
Mac OS X
|
|
|
|
--------
|
2009-04-10 11:01:56 +00:00
|
|
|
|
2010-11-17 21:32:23 -02:00
|
|
|
The easiest way to install Scrapy on Mac is through ``easy_install``, which
|
|
|
|
will automatically install Twisted and lxml as dependencies.
|
2009-03-22 22:05:23 +00:00
|
|
|
|
2010-11-17 21:32:23 -02:00
|
|
|
See :ref:`intro-install-easy`.
|
2009-03-22 22:05:23 +00:00
|
|
|
|
2010-11-17 21:32:23 -02:00
|
|
|
Windows
|
|
|
|
-------
|
|
|
|
|
|
|
|
There are two ways to install Scrapy in Windows:
|
|
|
|
|
|
|
|
* using ``easy_install`` or ``pip`` - see :ref:`intro-install-easy` or
|
|
|
|
:ref:`intro-install-pip`
|
|
|
|
|
|
|
|
* using the Windows installer, but you need to download and install the
|
|
|
|
dependencies manually:
|
|
|
|
|
|
|
|
1. `Twisted for Windows <http://twistedmatrix.com/trac/wiki/Downloads>`_ - you
|
|
|
|
may need to install `pywin32`_ because of `this Twisted bug`_
|
|
|
|
|
|
|
|
2. Install `Zope.Interface`_ (required by Twisted)
|
|
|
|
|
|
|
|
3. `libxml2 for Windows <http://users.skynet.be/sbi/libxml-python/>`_
|
|
|
|
|
|
|
|
4. `PyOpenSSL for Windows <http://sourceforge.net/project/showfiles.php?group_id=31249>`_
|
|
|
|
|
|
|
|
5. Download the Windows installer from the `Downloads page`_ and install it.
|
2008-12-16 15:40:27 +00:00
|
|
|
|
2010-11-17 21:32:23 -02:00
|
|
|
.. _Python: http://www.python.org
|
|
|
|
.. _Twisted: http://twistedmatrix.com
|
|
|
|
.. _lxml: http://codespeak.net/lxml/
|
|
|
|
.. _libxml2: http://xmlsoft.org
|
|
|
|
.. _pywin32: http://sourceforge.net/projects/pywin32/
|
|
|
|
.. _simplejson: http://pypi.python.org/pypi/simplejson/
|
|
|
|
.. _Zope.Interface: http://pypi.python.org/pypi/zope.interface#download
|
|
|
|
.. _this Twisted bug: http://twistedmatrix.com/trac/ticket/3707
|
|
|
|
.. _pip: http://pypi.python.org/pypi/pip
|
|
|
|
.. _setuptools: http://pypi.python.org/pypi/setuptools
|
|
|
|
.. _Mercurial: http://www.selenic.com/mercurial/
|
|
|
|
.. _Control Panel: http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/sysdm_advancd_environmnt_addchange_variable.mspx
|
|
|
|
.. _Downloads page: http://scrapy.org/download/
|