内容
- Linux部署Python3.6环境
- Mac部署Python3.6环境
- Window10部署Python3.6环境
- Pycharm安装
1. Linux部署Python3.6环境
-
登录官网找到Python3.6的下载地址
-
右键复制下载地址
-
下载及安装[登录linux服务器]
# yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel [安装依赖] # yum -y install sqlite-devel readline-devel tk-devel gdbm-devel [安装依赖] # yum -y install db4-devel libpcap-devel xz-devel [安装依赖] # yum -y install gcc gcc-c++ # cd /root/ # wget https://www.python.org/ftp/python/3.6.2/Python-3.6.2.tar.xz [下载] # tar xf Python-3.6.2.tar.xz [解压] # cd Python-3.6.2 # ./configure --prefix=/usr/local/python3.6 # make # make install
-
运行解释器
# cd /usr/local/python3.6/bin/ # ./python3.6
如图所示
-
使用PIp
pip相当于Python的模块管理工具,Python之所以强大原因之一就是第三方库的丰富 # cd /usr/local/python3.6/bin/ # ./pip3
-
配置环境变量
#ln -s /usr/local/python3.6/bin/python3 /usr/bin/python3 #ln -s /usr/local/python3.6/bin/pip3 /usr/bin/pip3
2. Mac部署Python3.6环境
-
使用brew工具管理
brew 又叫Homebrew,是Mac OSX上的软件包管理工具,能在Mac中方便的安装软件或者卸载软件
地址https://brew.sh/ -
安装brew
使用终端工具 # /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
-
使用brew安装Python3.6
# 在终端输入以下命令: # brew install python3 python安装完成,具体路径是:/usr/local/Cellar/python3/3.6.2/
-
运行解释器
# cd /usr/local/Cellar/python3/3.6.2/bin/ # ./python3
3. Window10部署Python3.6环境
-
登录官网找到Python3.6的下载地址
-
点击下载
-
安装
-
进入解释器