Xubantu环境搭建Python+seo常用库

xubantu环境搭建Python+seo常用库
python+seo模块
一、安装selenium

pip install selenium

安装PhantomJS

https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.7-linux-x86_64.tar.bz2
tar jxvf phantomjs-1.9.7-linux-x86_64.tar.bz2
cp phantomjs-1.9.7-linux-x86_64/bin/phantomjs /bin/
chmod 755 /bin/phantomjs

二、安装requests

pip install requests

三、安装pycurl
依赖环境

sudo apt-get install libcurl4-gnutls-dev
sudo apt-get install python-pycurl-dbg

最后

pip install pycurl

四、安装BeautifulSoup
现下载BeautifulSoup的包用wget
先使用xzvf解压,切换到有setup.py的目录下
使用

python setup.py install

最后

pip install beautifulsoup4

五、安装scrapy

pip install scrapy

六、安装Mysql客户端

sudo apt-get install mysql-server

七、安装MySQLdb
先安装下面两个东西

sudo apt-get install libmysqld-dev
sudo apt-get install libmysqlclient-dev

最后

pip installmysql-python

安装python模块时如出现:error: Setup script exited with error: command ‘gcc’ failed with exit status 1
解决

sudo apt-get install python-dev

Leave a Comment