标签:zip2 error: please data pac tool 文件 重命名 cloud
查看当前系统中的 Python 版本,可以看到实验室的这台服务器已经安装了 Python 2.6.6
python --version
检查 CentOS 版本,我们可以看到这台服务器的 CentOS的版本是 CentOS release 6.8
cat /etc/redhat-release
yum
源中没有新版 Python ,我们到官网中下载 Python 2.7.13更新系统默认 Python 版本
#!/usr/bin/python2.6 import sys try: import yum except ImportError: print >> sys.stderr, """\nThere was a problem importing one of the Python modules required to run yum. The error leading to this problem was: %s Please install a package which provides this module, or verify that the module is installed correctly. It‘s possible that the above module doesn‘t match the current version of Python, which is: %s If you cannot solve this problem yourself, please go to the yum faq at: http://yum.baseurl.org/wiki/Faq """ % (sys.exc_value, sys.version) sys.exit(1) sys.path.insert(0, ‘/usr/share/yum-cli‘) try: import yummain yummain.user_main(sys.argv[1:], exit_code=True) except KeyboardInterrupt, e: print >> sys.stderr, " Exiting on user cancel." sys.exit(1)
再查看 Python 版本,现在我们看到的已经是最新版了
python --version
为新版 Python 安装 pip
#!/usr/bin/python print "Hello, World!";
执行 python hello.py
标签:zip2 error: please data pac tool 文件 重命名 cloud
原文地址:http://www.cnblogs.com/beyang/p/7340629.html