国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > Python > 正文

在centos7中分布式部署pyspider

2020-02-16 01:28:42
字體:
來源:轉載
供稿:網友

1.搭建環境:

系統版本:Linux centos-linux.shared 3.10.0-123.el7.x86_64 #1 SMP Mon Jun 30 12:09:22 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

python版本:Python 3.5.1

1.1.搭建python3環境:

本人在嘗試過后選擇集成環境Anaconda

1.1.1.編譯

# 下載依賴yum install -y ncurses-devel openssl openssl-devel zlib-devel gcc make glibc-devel libffi-devel glibc-static glibc-utils sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-deve# 下載python版本wget https://www.python.org/ftp/python/3.5.1/Python-3.5.1.tgz# 或者使用國內源wget http://mirrors.sohu.com/python/3.5.1/Python-3.5.1.tgzmv Python-3.5.1.tgz /usr/local/src;cd /usr/local/src# 解壓tar -zxf Python-3.5.1.tgz;cd Python-3.5.1# 編譯安裝./configure --prefix=/usr/local/python3.5 --enable-sharedmake && make install# 建立軟鏈接ln -s /usr/local/python3.5/bin/python3 /usr/bin/python3echo "/usr/local/python3.5/lib" > /etc/ld.so.conf.d/python3.5.confldconfig# 驗證python3python3# Python 3.5.1 (default, Oct 9 2016, 11:44:24)# [GCC 4.8.5 20150623 (Red Hat 4.8.5-4)] on linux# Type "help", "copyright", "credits" or "license" for more information.# >>># pip/usr/local/python3.5/bin/pip3 install --upgrade pipln -s /usr/local/python3.5/bin/pip /usr/bin/pip# 本人在安裝時出現問題 將pip重裝wget https://bootstrap.pypa.io/get-pip.py --no-check-certificatepython get-pip.py

1.1.2.集成環境anaconda

# 集成環境anaconda(推薦)wget https://repo.continuum.io/archive/Anaconda3-4.2.0-Linux-x86_64.sh# 直接安裝即可./Anaconda3-4.2.0-Linux-x86_64.sh# 若出錯,可能是解壓失敗yum install bzip2

1.2.安裝mariaDB

# 安裝yum -y install mariadb mariadb-server# 啟動systemctl start mariadb# 設置為開機啟動systemctl enable mariadb# 配置密碼 默認為空mysql_secure_installation# 登錄mysql -u root -p# 創建一個用戶 自己設定賬戶密碼CREATE USER 'user_name'@'localhost' IDENTIFIED BY 'user_pass';GRANT ALL PRIVILEGES ON *.* TO 'user_name'@'localhost' WITH GRANT OPTION;CREATE USER 'user_name'@'%' IDENTIFIED BY 'user_pass';GRANT ALL PRIVILEGES ON *.* TO 'user_name'@'%' WITH GRANT OPTION;

1.3.安裝pyspider

本人使用Anaconda

# 搭建虛擬環境sbird python版本3.*conda create -n sbird python=3*# 進入環境source activate sbird# 安裝pyspiderpip install pyspider# 報錯 # it does not exist. The exported locale is "en_US.UTF-8" but it is not supported# 執行 可寫入.bashrcexport LC_ALL=en_US.utf-8export LANG=en_US.utf-8#ImportError: pycurl: libcurl link-time version (7.29.0) is older than compile-time version (7.49.0)conda install pycurl# 退出source deactivate sbird# 若在虛擬機內 出現無法訪問localhost:5000 可關閉防火墻systemctl stop firewalld.service#########直接運行源碼==============mkdir git;cd git# 下載git clone https://github.com/binux/pyspider.git# 安裝/root/anaconda3/envs/sbird/bin/python /root/git/pyspider/run.py            
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 洪湖市| 庆云县| 那坡县| 文登市| 婺源县| 交口县| 陵水| 进贤县| 黔西县| 华宁县| 德昌县| 综艺| 昌图县| 历史| 仁化县| 舟山市| 元氏县| 马山县| 平遥县| 栾川县| 恭城| 武汉市| 延川县| 和顺县| 卢湾区| 奉新县| 敦煌市| 普格县| 峨眉山市| 营山县| 罗山县| 博白县| 新建县| 浮山县| 凌云县| 冕宁县| 永福县| 石屏县| 逊克县| 大洼县| 巨鹿县|