今天学习浏览器模拟,把云端centos上的python2.7升级到3.6,但是安装其他软件时发现报如下错误: File "/usr/bin/yum", line 30 except KeyboardInterrupt, e: ^SyntaxError: invalid syntax 此问题原因是系统默认安装文件等需要调用python2.7,执行文件的第一行是#!/usr/bin/python,这样在装了3.6之后就会默认调用3.6了,而不是原来默认的2.7了, 解决方法: 修改yum配…
使用yum命令报错 File "/usr/bin/yum", line 30 except KeyboardInterrupt, e: ^ SyntaxError: invalid syntax 问题出现原因:yum包管理是使用python2.x写的,将python2.x升级到python3.x以后,由于python版本语法兼容性导致问题出现 解决办法: 修改yum配置文件,将python版本指向以前的旧版本 vi /usr/bin/yum #!/usr/bin/python2.7 修…
最近在虚拟机上执行yum命令一直报错:Could not parse metalink https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=i386 error was No repomd fileError: File /var/cache/yum/i386/6/epel/metalink.xml does not existyum源是没问题的 按照网上的说法也换了个163的源,yum clean all.yum makeca…
Loaded plugins: fastestmirror, security Loading mirror speeds from cached hostfile Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os error was 14: PYCURL ERROR 6 - "Couldn't resolve host 'mirrorlist.cen…
CentOS升级Python2.7及安装pip 1) 升级Python2.7 ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 python -V  # 查看版本:Python 2.6.6   mkdir -p ~/Env/python; cd ~/Env/python  # 创建个目录   wget --no-check-certificate https://www…
centos在yum install报错:Another app is currently holding the yum lock,这个问题可能是很多的新手经常遇到问题,之前也有人问我,包括本人在刚刚学习centos的时候也遇到过. Another app is currently holding the yum lock,这个意思很明显就是说,有另外一个应用在使用yum,被占用锁定了,所以咋办呢,直接结束掉呗. 可以通过强制关掉yum进程: # rm -f /var/run/yum.pid…
同时安装Python2与Python3,安装第三方包,老是报错提示Fatal error in launcher: Unable to create process using '"',那可能是环境变量有冲突了. 解决办法: 是在环境变量Path中上下移调整两个"PythonX/Scripts"位置,使之位于前两位(哪个版本常用就靠前): 是使用另一种命令python3 -m pip install requests来安装.…
python2中的unicode()函数在python3中会报错:NameError: name 'unicode' is not defined There is no such name in Python 3, no. You are trying to run Python 2 code in Python 3. In Python 3, unicode has been renamed to str. 翻译过来就是:Python 3中没有这样的名字,没有. 您正在尝试在Python 3…
原文:http://ruter.sundaystart.net/2015/12/03/Update-python/ 貌似CentOS 6.X系统默认安装的Python都是2.6版本的?平时使用以及很多的库都是要求用到2.7版本或以上,所以新系统要做的第一件事必不可少就是升级Python啦!在这里做个简单的升级操作记录 :) 0. 依赖安装   yum -y update yum install epel-release yum install sqlite-devel yum install -…
个人博客:https://blog.sharedata.info/ 貌似CentOS 6.X系统默认安装的Python都是2.6版本的?平时使用以及很多的库都是要求用到2.7版本或以上,所以新系统要做的第一件事必不可少就是升级Python啦!在这里做个简单的升级操作记录 :)升级Python系统默认安装的Python是2.6.6的,我们需要升级到Python2.7,用wget命令从官方下载源文件,然后解压进行编译wget http://www.python.org/ftp/python/2.7.…