国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > Python > 正文

詳解Python 2.6 升級至 Python 2.7 的實踐心得

2020-02-23 04:38:20
字體:
來源:轉載
供稿:網友

前言

CentOS 6.8 安裝 Python 2.7.13,因為軟件版本上的需求所以考慮將 Python 升級至 2.7.13,加上生產環境還是以 RHEL 6 為主,互聯網自動化運維平臺大多數也推薦以Python 2.7.x + CentOS 6.x 來操作,選擇 Python 2 還是 Python 3 也沒有定論,找到適合的搭配即可。

簡單安裝

因為Python 2.7.13以后版本會自動完善yum配置,所以不必參考以前的網上文章去修改其他地方

# 查看當前系統中的 Python 版本,返回 Python 2.6.6 為正常python --versionPython 2.6.6# 檢查 CentOS 版本,返回 CentOS release 6.8 (Final) 為正常cat /etc/redhat-releaseCentOS release 6.8 (Final)# 安裝所有的開發工具包yum groupinstall -y "Development tools"# 安裝其它的必需包yum install -y zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel# 下載、編譯和安裝 Python 2.7.13#wget https://www.python.org/ftp/python/2.7.13/Python-2.7.13.tgztar zxf Python-2.7.13.tgzcd Python-2.7.13./configuremake && make install# 查看新的 Python 版本,返回 Python 2.7.13 為正常python --versionPython 2.7.13

ansible離線安裝實踐

這里利用了一些內網離線安裝ansible的小技巧。

# Install Pythontar xf Python-2.7.13.tgzcd Python-2.7.13./configuremakemake install# ImportError: No module named six.movestar xf six-1.10.0.tar.gzcd six-1.10.0python setup.py installcd ..# ImportError: No module named packaging.versiontar xf packaging-16.8.tar.gzcd packaging-16.8python setup.py installcd ..# ImportError: No module named pyparsingtar xf pyparsing-2.2.0.tar.gzcd pyparsing-2.2.0python setup.py installcd ..# ImportError: No module named appdirstar xf appdirs-1.4.3.tar.gzcd appdirs-1.4.3python setup.py installcd ..# Install Setuptoolsunzip setuptools-34.2.0.zipcd setuptools-34.2.0python setup.py installcd ..# Install piptar xf pip-9.0.1.tar.gzcd pip-9.0.1python setup.py installcd ..# pip 離線下載依賴包pip install -d ~/tmp/ ansiblepip install -d ~/tmp/ ansible-cmdb# pip 離線安裝pip install ansible --index-url=http://172.31.197.1:7000/simple/ --trusted-host=172.31.197.1pip install ansible-cmdb --index-url=http://172.31.197.1:7000/simple/ --trusted-host=172.31.197.1# 查看安裝好的版本[root@ansible-wangao ansible]# pip -Vpip 9.0.1 from /usr/local/lib/python2.7/site-packages/pip-9.0.1-py2.7.egg (python 2.7)[root@ansible-wangao ansible]# ansible --versionansible 2.3.0.0 config file = /etc/ansible/ansible.cfg configured module search path = Default w/o overrides python version = 2.7.13 (default, Apr 25 2017, 17:19:23) [GCC 4.4.7 20120313 (Red Hat 4.4.7-17)][root@ansible-wangao ansible]# ansible-cmdb --versionansible-cmdb v1.20# 更換豆瓣pip源vim $HOME/.pip/pip.conf[global]index-url = https://pypi.doubanio.com/simple/[install]trusted-host=pypi.doubanio.com

Windows 安裝 Python 2.7.x

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 砀山县| 天柱县| 常山县| 胶州市| 江安县| 嘉鱼县| 乌拉特中旗| 潞城市| 铁岭县| 塔城市| 潼关县| 凯里市| 巍山| 河西区| 正镶白旗| 陈巴尔虎旗| 雅江县| 万年县| 宜城市| 萝北县| 镇远县| 北川| 樟树市| 广宗县| 东方市| 襄汾县| 嘉峪关市| 嵊州市| 宁明县| 南漳县| 洪泽县| 多伦县| 康乐县| 毕节市| 木里| 白山市| 涞源县| 白沙| 玉溪市| 疏附县| 岳普湖县|