提交 03fc6fc4 编写于 作者: P Pablo Hoffman

made scrapy installation guide a bit more friendly for windows users

--HG--
extra : convert_revision : svn%3Ab85faa78-f9eb-468e-a121-7cced6da292c%401011
上级 30a3df0c
...@@ -39,15 +39,15 @@ If you're running Ubuntu/Debian Linux run the following command as root:: ...@@ -39,15 +39,15 @@ If you're running Ubuntu/Debian Linux run the following command as root::
Arch Linux Arch Linux
---------- ----------
If you are running Arch Linux use the following command to install required dependencies:: If you are running Arch Linux run the following command as root::
pacman -S twisted libxml2 pyopenssl pacman -S twisted libxml2 pyopenssl
MacOSX MacOSX
------ ------
MacOSX ships an libxml2 version too old to be used by Scrapy. Also, by MacOSX ships an ``libxml2`` version too old to be used by Scrapy. Also, by
looking on the web it seems that installing libxml2 on MacOSX is a bit looking on the web it seems that installing ``libxml2`` on MacOSX is a bit
of a challenge. Here is a way to achieve this, though not acceptable of a challenge. Here is a way to achieve this, though not acceptable
on the long run: on the long run:
...@@ -70,7 +70,7 @@ referencing your current python framework. ...@@ -70,7 +70,7 @@ referencing your current python framework.
sudo make install sudo make install
The libraries and modules should be installed in something like The libraries and modules should be installed in something like
/usr/local/lib/python2.5/site-packages. Add it to your PYTHONPATH /usr/local/lib/python2.5/site-packages. Add it to your ``PYTHONPATH``
and you are done. Check the library is there with a simple:: and you are done. Check the library is there with a simple::
python -c 'import libxml2' python -c 'import libxml2'
...@@ -84,8 +84,8 @@ Download and install: ...@@ -84,8 +84,8 @@ Download and install:
2. `PyOpenSSL for Windows <http://sourceforge.net/project/showfiles.php?group_id=31249>`_ 2. `PyOpenSSL for Windows <http://sourceforge.net/project/showfiles.php?group_id=31249>`_
3. `libxml2 for Windows <http://users.skynet.be/sbi/libxml-python/>`_ 3. `libxml2 for Windows <http://users.skynet.be/sbi/libxml-python/>`_
Install Scrapy code Install Scrapy
=================== ==============
We're working hard to get the first release of Scrapy out. In the meantime, We're working hard to get the first release of Scrapy out. In the meantime,
please download the latest development version from the Subversion_ repository. please download the latest development version from the Subversion_ repository.
...@@ -100,24 +100,43 @@ To do this, follow this steps: ...@@ -100,24 +100,43 @@ To do this, follow this steps:
2. Add Scrapy to your Python path: 2. Add Scrapy to your Python path:
You can do this by making a symbolic link to your system ``site-packages`` If you're using Linux, Mac OS X or some other flavor of Unix, you can do
directory like this:: this by making a symbolic link to your system ``site-packages`` directory
like this::
ln -s `pwd`/scrapy-trunk/scrapy SITE-PACKAGES/scrapy ln -s /path/to/scrapy-trunk/scrapy SITE-PACKAGES/scrapy
Where ``SITE-PACKAGES`` is the location of your system ``site-packages`` Where ``SITE-PACKAGES`` is the location of your system ``site-packages``
directory, to find this out execute the following:: directory, to find this out execute the following::
python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()" python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"
Or by adding the ``scrapy-trunk`` directory to your ``PYTHONPATH`` environment Alternatively, you can define your ``PYTHONPATH`` environment variable so
variable, like this:: that it includes the scrapy-trunk directory. This is probably the most
convenient solution on Windows systems, which don't support symbolic links.
(Environment variables can be defined on Windows systems from the `Control
Panel`_.
Unix-like example::
PYTHONPATH=/path/to/scrapy-trunk
Windows example (from command line, but you should probably use the `Control
Panel`_)::
export PYTHONPATH=`pwd`/scrapy-trunk:$PYTHONPATH set PYTHONPATH=C:\path\to\scrapy-trunk
3. Make the ``scrapy-trunk/scrapy/bin/scrapy-admin.py`` script executable 3. Make the ``scrapy-admin.py`` script executable system-wide. This step is
system-wide. To do this create a symbolic link to the file in a directory on optional, but convenient. If you want to be able to run "scrapy-admin-py"
your sistem path, like:: without using its full path, you can:
In Unix-like platforms: create a symbolic link to the file in a directory on
your system path. Example::
ln -s `pwd`/scrapy-trunk/scrapy/bin/scrapy-admin.py /usr/local/bin ln -s /path/to/scrapy-trunk/scrapy/bin/scrapy-admin.py /usr/local/bin
In Windows platforms, add the ``C:\path\to\scrapy-trunk\scrapy\bin`` folder
to the ``PATH`` environment variable using the `Control Panel`_.
.. _Control Panel: http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/sysdm_advancd_environmnt_addchange_variable.mspx
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册