1. 程式人生 > >Linux系統上執行scrapy框架程式碼環境安裝教程

Linux系統上執行scrapy框架程式碼環境安裝教程

1: we have to install python enviroment.Linux system has its own python,but the edtion maybe too old.we can use it or install our own python.The way to install python is following.

install python

sudo yum install -y python36u python36u-libs python36u-devel python36u-pip
python3.6 -V

other way

wget https://www.python.org/ftp/python/3.6.4/Python-3.6.4.tar.xz
tar -xJf Python-3.6.4.tar.xz
cd Python-3.6.4
./configure

make
make install

note:the problem i had after i install python is :i input python in the terminal to check if python is install successfully.but it said python is not a comman!.I thoght i failed in installing,so i tried many ways.But i found the way i checked is worong!i have to input python3.6 -V to check!

2:have to install environment for scrapy ,anaconda can also be used in Linux.The way to install anaconda is following:

install anaconda

curl -O

https://repo.anaconda.com/archive/Anaconda3-5.3.0-Linux-x86_64.sh
sh Anaconda3-5.3.0-Linux-x86_64.sh

say yes

use anaconda

export PATH="/root/anaconda3/bin:$PATH"
conda

note:just do every step one by one.

3.add anaconda to system path

參考:https://blog.csdn.net/m0_37041325/article/details/77169972
1.修改~/.bashrc

2.新增export PATH=/home/lishanliao/anaconda3/bin:$PATH

3.source ~/.bashrc

4.install scrapy and redis 、pymongo

conda install -c scrapinghub scrapy
redis and pymongo cannot be install by conda,so we have to use:pip install redis/pip install pymongo to finsh the install .

It takes me two day to solve the problems ,but now i am successfully install the linux environment for scrapy!
Even i am slow but can not give up!