栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

关于python的环境配置

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

关于python的环境配置

关于python Windows中python的安装

安装完成后,按下win+R ,输入cmd进入命令行

输入python --version可以查看是否安装(或者python -V)

输入python进入命令行后,可以输入quit()退出当前模式

Linux中python的安装
#输入以下文字安装python
[root@localhost ~]# 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

可以提前准备python安装包

进入/opt目录

[root@localhost ~]# cd /opt

#将提前下好的python包拖入(可以去官网下),或者输入

[root@localhost opt]# wget http://npm.taobao.org/mirrors/python/3.9.0/Python-3.9.0.tgz

#如果没有wget命令,输入yum -y install wget,安装

安装python3
1.创建目录
[root@localhost opt]# mkdir -p /usr/local/python3

2.解压

[root@localhost opt]# tar -zxvf Python-3.9.0.tgz

3.安装gcc包
[root@localhost opt]# yum install gcc

4.安装libffi-devel包

[root@localhost opt]# yum install libffi-devel -y

5.[root@localhost opt]# cd Python-3.9.0/

6.[root@localhost Python-3.9.0]# ./configure --prefix=/usr/local/python3

7.编译

[root@localhost Python-3.9.0]# make

8.编译完成后安装

[root@localhost Python-3.9.0]# make install

9.检查

[root@localhost Python-3.9.0]# /usr/local/python3/bin/python3

10.[root@localhost Python-3.9.0]# vim /etc/profile #复制以下内容

# .bash_profile

# Get the aliases and functions

if [ -f ~/.bashrc ]; then

. ~/.bashrc

fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin:/usr/local/python3/bin

export PATH

Esc,:wq 保存退出

[root@localhost Python-3.9.0]# source /etc/profile

12.验证

[root@localhost Python-3.9.0]# python3 -V

[root@localhost Python-3.9.0]# pip3 -V

[root@localhost Python-3.9.0]# python3

python安装完成

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/307726.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号