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 pythonsudo..
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 --prefix=/usr/local/python3
make && make install
ln -s /usr/local/python3/bin/python3.6 /usr/bin/python
ln -s /usr/local/python3/bin/pip3 /usr/bin/pip
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
(1)curl -O
https://repo.anaconda.com/archive/Anaconda3-5.3.0-Linux-x86_64.sh
(2)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!
https://www.jianshu.com/p/a72566e539be
更多推荐
所有评论(0)