很多时候线上机我们是没有root的,即使有root权限安装只有自己用到的库也不合适,所以在开发过程中,很多时候会用到本地安装
1、python 安装
下载:wget https://www.python.org/ftp/python/2.7.13/Python-2.7.13.tgz
解压:tar zxvf Python-2.7.13.tgz
配置安装到的路径:./configure --prefix=/home/zhaohongjie/python/python2.7/
make&&make install
以上四步之后,python已经安装结束,检验一下是否安装正确,到/home/zhaohongjie/python/python2.7/bin/路径下执行 ./python2.7
Python 2.7.13 (default, Sep 5 2017, 21:11:25)
[GCC 4.4.6 20110731 (Red Hat 4.4.6-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
2、beautifulsoup安装
下载:http://www.crummy.com/software/BeautifulSoup/bs4/download/4.2/
解压:tar -xzvf beautifulsoup4-4.2.0.tar.gz
安装:/home/zhaohongjie/python/python2.7/bin/python2.7 setup.py build
/home/zhaohongjie/python/python2.7/bin/python2.7 setup.pyinstall
确认beautifulsoup是否安装成功,/home/zhaohongjie/python/python2.7/bin/python2.7执行from bs4 import BeautifulSoup。如果不报错表示安装成功
本文详细介绍了如何在没有root权限的情况下进行Python 2.7.13的本地安装,并提供了具体步骤。此外,还提供了如何安装BeautifulSoup库的方法,包括下载、解压及通过Python脚本进行构建和安装的具体指令。
526

被折叠的 条评论
为什么被折叠?



