您的位置:首页 > 理论基础 > 计算机网络

Python网络爬虫之scrapy安装

2016-11-04 15:06 316 查看
参考:https://doc.scrapy.org/en/latest/index.html

1,安装pip

wget https://bootstrap.pypa.io/get-pip.py sudo python get-pip.py


2,安装virtualenv

sudo pip install virtualenv


3,创建ENV

virtualenv ENV


4,activate script

cd ENV
source bin/activate


This will change your $PATH so its first entry is the virtualenv’s bin/ directory. (You have to use source because it changes your shell environment in-place.) This is all it does; it’s purely a convenience. If you directly run a script or the python interpreter from the virtualenv’s bin/ directory (e.g. path/to/ENV/bin/pip or /path/to/ENV/bin/python-script.py) there’s no need for activation.

The activate script will also modify your shell prompt to indicate which environment is currently active. To disable this behaviour, see VIRTUAL_ENV_DISABLE_PROMPT.

To undo these changes to your path (and prompt), just run:

deactivate


5,To install scrapy on Ubuntu (or Ubuntu-based) systems, you need to install these dependencies:

(ENV) kylefan@kylefan-pc:~/ENV$ sudo apt-get install python-dev python-pip libxml2-dev libxslt1-dev zlib1g-dev libffi-dev libssl-dev


Inside a virtualenv, you can install Scrapy with pip after that:

(ENV) kylefan@kylefan-pc:~/ENV$ pip install scrapy
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  python 网络爬虫 scrapy