python 安装
1.下载地址:https://www.python.org/ftp/python/2.7.15/Python-2.7.15.tgz
2. ./configure --enable-shared --enable-loadable-sqlite-extensions \
--prefix=/usr/local/python27 --with-zlib --with-ssl
make
make install
3. mv /usr/bin/python /usr/bin/python2.6.6
ln -s /usr/local/python27/bin/python2.7 /usr/bin/python
4. vim /etc/ld.so.conf
# 添加如下一行内容
/usr/local/python27/lib
ldconfig # 使新添加的路径生效
5. 安装pip
1. 下载安装
[root@vip ~]# wget https://bootstrap.pypa.io/get-pip.py
[root@vip ~]# python get-pip.py
2. 设置软连接
[root@vip ~]# ln -s /usr/local/python27/bin/pip2.7 /usr/bin/pip
参考
https://www.cnblogs.com/liwei0526vip/p/6219998.html
python 使用
1. 数据库操作
pip install mysql-python
基础教程
https://www.liaoxuefeng.com/wiki/001374738125095c955c1e6d8bb493182103fac9270762a000/001374738264643de15c5c4abad47dd9510e3b86286acb8000
http://www.runoob.com/python3/python3-socket.html
http://www.pythonav.com/special/100-7.html
https://code.ziqiangxuetang.com/django/django-tutorial.html
python学习整理
http://blog.51cto.com/9272317/1869914
参考:
https://www.cnblogs.com/guohaojintian/p/6030818.html
PyCharm IDE 开发环境
https://www.jianshu.com/p/df4eee09496d
python3 安装
1. 下载
官网 download 找到下载链接 使用wget下
wget https://www.python.org/ftp/python/3.6.5/Python-3.6.5.tgz
tar xvf Python-3.6.5.tgz
cd Python-3.6.5
2. 配置安装
./configure --prefix=/usr/local/python3
make && make install
3. 添加软连接 快捷方式
ln -s /usr/local/python3/bin/python3 /usr/bin/python3
ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3
4. 卸载
rm -rf /usr/loacl/python3
4. 备注
最好不要覆盖python原来环境
爬虫
安转
# 网络请求库
pip3 install requests
# dom 操作
pip3 install beautifulsoup4 pip3 install lxml
# python 类似 jquery 的网页解析库
pip3 install pyquery
参考:
http://www.cnblogs.com/zhaof/p/6898138.html