zoukankan      html  css  js  c++  java
  • Linux:Python3.5安装和配置

    安装前系统设置

    1、防火墙设置
    centos7.0默认防火墙为firewalld
    停止firewall
    systemctl stop firewalld.service

    禁止firewall开机启动
    systemctl disable firewalld.service

    查看默认防火墙状态:
    firewall-cmd --state

    2、修改selinux
    setenforce 0
    vi /etc/selinux/config
    将SELINUX=enforcing改为:SELINUX=disabled

    二、安装Python3

    CentOS7默认安装了python2.7,当需要使用python3的时候,可以手动下载Python源码后编译安装。

    1.安装python3.5可能使用的依赖
    yum -y install openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel

    2.下载python
    cd /opt/
    scp 10.32.35.100:/data/share/Python-3.5.0.tgz /opt/

    3.解压下载好的压缩包
    tar -zxvf Python-3.5.0.tgz

    4.配置编译
    mkdir /usr/local/python3
    cd Python-3.5.0
    ./configure --prefix=/usr/local/python3
    make
    make install

    5.备份旧版本python,链接新版本python
    cd /usr/bin/
    mv python python.bak
    ln -s /usr/local/python3/bin/python3 /usr/bin/python
    python -V

    6.修改yum配置文件
    vi /usr/bin/yum
    将第一行指定的python版本改为python2.7(#!/usr/bin/python 改为 #!/usr/bin/python2.7)

    三、安装BeautifulSoup4
    scp 10.32.35.100:/data/share/beautifulsoup4-4.6.0.tar.gz /opt/
    tar -zxvf beautifulsoup4-4.6.0.tar.gz
    cd beautifulsoup4-4.6.0
    python setup.py install

  • 相关阅读:
    QT内置的ICON资源
    Spark源代码阅读笔记之MetadataCleaner
    Android API Guides---Bluetooth
    做一个WINDOWS下破解WIFI。不须要Linux抓包!
    CPU GPU设计工作原理《转》
    杭电 1280 前m大的数
    机房收费系统——报表(2)
    概览C++之const
    Android动态禁用或开启屏幕旋转工具
    shrink-to-fit(自适应宽度)
  • 原文地址:https://www.cnblogs.com/zhenqk/p/12387446.html
Copyright © 2011-2022 走看看