1 python安装

python安装

配置yum源

//配置yum源
[root@localhost ~]# rpm -ivh http://mirror.centos.org/centos/7/os/x86_64/Packages/wget-1.14-18.el7.x86_64.rpm
[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# wget http://mirrors.163.com/.help/CentOS7-Base-163.repo
[root@localhost ~]# sed -i 's/\$releasever/7/g' /etc/yum.repos.d/CentOS7-Base-163.repo
[root@localhost ~]# sed -i 's/^enabled=.*/enabled=1/g' /etc/yum.repos.d/CentOS7-Base-163.repo
[root@localhost src]# yum clean all
[root@localhost ~]# yum -y install epel-release

Python编译安装

//下载Python程序源码包
[root@localhost ~]# cd /usr/src
[root@localhost ~]# wget https://www.python.org/ftp/python/3.7.3/Python-3.7.3.tar.xz
[root@localhost src]# ls
debug  kernels  Python-3.7.3.tar.xz

//安装编译器与依赖包
[root@localhost src]# yum -y install gcc gcc-c++ make zlib-devel libffi-devel openssl openssl-devel bzip2 bzip2-devel vim readline-devel ncurses-devel sqlite-devel gdbm-devel xz-devel tk-devel


//编译安装
[root@localhost src]# tar xf Python-3.7.3.tar.xz
[root@localhost src]# cd Python-3.7.3
[root@localhost Python-3.7.3]# ls
aclocal.m4           configure     Include     m4               Modules  PCbuild        README.rst
CODE_OF_CONDUCT.rst  configure.ac  install-sh  Mac              Objects  Programs       setup.py
config.guess         Doc           Lib         Makefile.pre.in  Parser   pyconfig.h.in  Tools
config.sub           Grammar       LICENSE     Misc             PC       Python
[root@localhost Python-3.7.3]# ./configure --prefix=/usr/local/python37
[root@localhost Python-3.7.3]# make
[root@localhost Python-3.7.3]# make install

//安装后配置
[root@localhost ~]# ls /usr/local/python37/
bin  include  lib  share
[root@localhost ~]# echo 'export PATH=/usr/local/python37/bin:$PATH' > /etc/profile.d/py3.sh
[root@localhost ~]# source /etc/profile.d/py3.sh
[root@localhost ~]# echo $PATH
/usr/local/python37/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
[root@localhost ~]# which python3
/usr/local/python37/bin/python3
[root@localhost ~]# pip3.7 install --upgrade pip

PyCharm安装

PyCharm管网上下载	https://www.jetbrains.com/pycharm/download/#section=windows
下载选择Community社区版下载就行
下载完后双击安装
如果电脑没有Python的解释器,需要安装一个解释器
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值