centos7安装python3.5后文件不兼容问题

源码安装python3.5

          1.      准备环境

                      yum install gcc-* glibc-* -y

          2.     下载python3.5源码安装包 

                      wget https://www.python.org/ftp/python/3.5.2/Python-3.5.2.tar.xz

          3.      解包  

                      tar xvf python-3.5.2.tgz(提前建立解包文件夹)

          4.      执行configure脚本,添加编译参数例如:--prefix制定安装路径

                      cd Python-3.5.2

                      mkdir /usr/local/python3.5

                      ./configure --prefix=/usr/local/python3.5

          5.      编译    make

          6.      安装   make install

安装后python3.7启动问题:

1.在目录/usr/bin下建立软连接方便启动

ln -s /usr/local/python3/bin/python3 /usr/bin/python3

2.备份python2.7

mv /usr/bin/python /usr/bin/python.bak

3.对python3.7改名

mv /usr/bin/python3.7 /usr/bin/python

安装后软件不兼容问题:

因为很多软件是python2.7写的.使用python3.7会出现不兼容问题。

1.找到软件的配置文件

a.yum配置文件:/user/bin/yum

b.防火墙firewalld配置文件: /usr/sbin/firewalld

c.还有很多如果安装后一些软件不能启动就得考虑是不是python写的

2.对配置文件第一行的#!/usr/bin/python -Es 改为 #!/usr/bin/python2.7 -Es

原文地址:https://www.cnblogs.com/ailadi/p/9951425.html

时间: 2024-10-08 07:24:54

centos7安装python3.5后文件不兼容问题的相关文章

CentOS7 安装 Python3.8后 pip 安装报错

[[email protected] Python-3.8.0]# pip install bs4 Collecting bs4 Using cached https://files.pythonhosted.org/packages/10/ed/7e8b97591f6f456174139ec089c769f89a94a1a4025fe967691de971f314/bs4-0.0.1.tar.gz ERROR: Command errored out with exit status 1: c

centos7安装python3和Django后,ModuleNotFoundError: No module named '_sqlite3'

1.准备安装环境 yum groupinstall 'Development Tools' yum install zlib-devel bzip2-devel openssl-devel ncurses-devel 2.安装python3 去官网下载编译安装包或者直接执行以下命令下载 wget https://www.python.org/ftp/python/3.6.2/Python-3.6.2.tar.xz 解压 tar -xvJf  Python-3.6.2.tar.xz 切换进入 cd

Centos7 安装Python3.6.5 及 安装ipython 6.1.0

一.centos7 安装 Python3.6.5教程 1.在安装Python之前,需要先安装一些后面遇到的依赖问题(如果有依赖问题,按照提示安装): yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel     yum install xz gcc zlib 

安装python3.6后使用pip报错

安装python3.6后,pip是一起安装好的,安装目录再C:\Programs\Python\Python36-32\Scripts中. 在python终端模式下使用pip出现错误如下: 错误原因:pip不应在python终端模式下使用:直接在cmd下使用pip即可. 原文地址:https://www.cnblogs.com/feitian629/p/10362154.html

Centos7安装Python3详细步骤

这一篇是在一个大神基础上改动的 安装python3.6可能使用相关软件 这里如果不安python3可能也可以正常安装,但是当用的时候就会出问题,所以都安装一下 # yum groupinstall 'Development Tools' # yum install -y ncurses-libs zlib-devel mysql-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel g

CentOS7安装python3.6

下载包 去官网下载最新的python安装包 官网地址: https://www.python.org/downloads/ 安装python3.6可能使用的依赖 yum install openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel yum install -y readline-devel.x86_64 (一定要安装这个包,不然升级完成后会发现删除退格键用不了) 时间同步 ntpdate

centos7 安装python3

安装python3.7 wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz 下载完成后到下载目录下,解压 tar -zxvf Python-3.7.0.tgz 进入解压缩后的文件夹 cd Python-3.7.0 安装python3的依赖:yum -y groupinstall "Development tools"yum install openssl-devel bzip2-devel expat-devel

CentOS7安装Python3.6.5

一.安装python3.6可能使用相关软件 # yum groupinstall 'Development Tools' # yum install -y ncurses-libs zlib-devel mysql-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel 二.安装python3.6.5

CentOS7 安装Python3.6.8

1. 安装依赖环境 yum -y groupinstall "Development tools" yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel 2.下载Python3.6.8 新建个/usr/local/python3文件夹 mkdir /