Windows Subsystem for Linux使用笔记

13 Nov 2017

1 安装scrapy

  1. 安装虚拟环境,
  2. 升级py安装工具
    pip install --upgrade pip
    pip install --upgrade setuptools
    
  3. 安装依赖包
    sudo apt-get install python3 python-dev python3-dev \
     build-essential libssl-dev libffi-dev \
     libxml2-dev libxslt1-dev zlib1g-dev \
     python-pip
    
  4. 安装scrapy
    pip install scrapy
    

2 apt使用代理

临时代理

export http_proxy=http://yourproxyaddress:proxyport

全局代理

sudo vi /etc/apt/apt.conf

Acquire::http::proxy "http://127.0.0.1:1080/";
Acquire::ftp::proxy "ftp://127.0.0.1:1080/";
Acquire::https::proxy "https://127.0.0.1:1080/";

BASH rc method

sudo vi ~/.bashrc

http_proxy=http://yourproxyaddress:proxyport
export http_proxy

source ~/.bashrc

需要登录的代理

http_proxy=http://username:password@yourproxyaddress:proxyport