时间:2021-07-01 10:21:17 帮助过:3人阅读
windows:同时安装2.7和3.5
1、下载安装包
https://www.python.org/downloads/
2、安装
默认安装路径:C:\python27
3、配置环境变量
【右键计算机】--》【属性】--》【高级系统设置】--》【高级】--》【环境变量】--》【在第二个内容框中找到 变量名为Path 的一行,双击】 --> 【Python安装目录追加到变值值中,用 ; 分割】
如:原来的值;C:\python27,切记前面有分号
linux:将2.7改成3.5
yum -y install python-devel openssl openssl-devel gcc sqlite sqlite-devel mysql-devel libxml2-devel libxslt-devel wget https://www.python.org/ftp/python/3.5.2/Python-3.5.2.tar.xz tar xf Python-3.5.2.tar.xz ./configure --prefix=/usr/local/python3.5 --with-threads --enable-shared make && make altinstall mv /usr/bin/pip /usr/bin/pip_old mv /usr/bin/easy_install /usr/bin/easy_install_old mv /usr/bin/python /usr/bin/python_old ln -s /usr/local/python3.5/lib/libpython3.5m.so /usr/lib ln -s /usr/local/python3.5/lib/libpython3.5m.so.1.0 /usr/lib ln -s /usr/local/python3.5/lib/libpython3.5m.so /usr/lib64 ln -s /usr/local/python3.5/lib/libpython3.5m.so.1.0 /usr/lib64 ln -s /usr/local/python3.5/bin/python3.5 /usr/bin/python ln -s /usr/local/python3.5/bin/easy_install-3.5 /usr/bin/easy_install ln -s /usr/local/python3.5/bin/pip3.5 /usr/bin/pip /sbin/ldconfig -v python
以上就是python安装哪个版本的详细内容,更多请关注Gxl网其它相关文章!