在安装或者启动Terminator时可能出现这个问题:

lin@Dev:~$ terminator
File "/usr/bin/terminator", line 123
except (KeyError,ValueError), ex:
^
SyntaxError: invalid syntax

错误原因:语法错误.这是因为Terminator的安装或者运行需要python2的环境,但是却用python3的环境去运行Terminator了.

我们查看Terminator的启动脚本文件,在'/usr/bin'下.

vi /usr/bin/terminator
#!/usr/bin/python
# Terminator - multiple gnome terminals in one window
# Copyright (C) 2006-2010 cmsj@tenshu.net
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 2 only.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
# USA """Terminator by Chris Jones <cmsj@tenshu.net>""" import sys
import os
import psutil
....
....

第一行标示使用的是系统默认的python脚本.

系统安装的python的版本有两个分别是python2.7和python3.6,当python链接到python2.7时,程序运行正常,链接到python3.6时出现以上的语法错误。

解决方法

1. 将系统默认的python版本链接到2(不建议)

2.  修改terminator的启动脚本(/usr/bin/terminator)如下:

#! /usr/bin/python2

保存退出重新运营terminator,成功.

解决无法运行Terminator出现以下问题: File "/usr/bin/terminator"...SyntaxError: invalid syntax的更多相关文章

  1. yum运行报错:File "/usr/bin/yum", line 30 except KeyboardInterrupt, e: ^SyntaxError: invalid syntax

    这是由于Python升级导致 备份Python 历史版本 [root@sdw1 autoconf]# ls /usr/bin/python* [root@sdw1 autoconf]# mv /usr ...

  2. Windows编译Nodejs时遇到 File "configure", line 313 SyntaxError: invalid syntax Failed to create vc project files. 时的解决方法

    第一次编译的时候电脑上未安装python,遂下载了python最新版本3.3.3,但是报了下面这个错误. 把python降到2.7.*的版本即可. 我这里测试2.7.6和2.7.3版本可以正常编译.

  3. python中执行py文件出错(提示File “<stdin>”,line 1,SyntaxError:invalid syntax)

    解决办法: 上图中已通过输入python进入了python运行环境,出现>>>时候的不能再用python z.py 来运行hello.py文件: 应该通过exit()退出当前pyth ...

  4. yum安装命令:遇到的问题报错如下: File "/usr/bin/yum", line 30 except KeyboardInterrupt, e: 通过看报错可以了解到是使用了python2的语法,所以了解到当前yum使用的Python2,因为我单独安装了python3,且python3设置为默认版本了,所以导致语法问题 解决方法: 使用python2.6 yum install

    1.安装zip yum install -y unzip zip 2.安装lrszs yum -y install lrzsz 3.安装scp 遇到下面的问题: 结果提示: No package sc ...

  5. python升级带来的yum异常(解决错误File "/usr/bin/yum", line 30 except KeyboardInterrupt, e:)

    解决错误File "/usr/bin/yum", line 30 except KeyboardInterrupt, e: 错误: 原因: 这是因为yum采用python作为命令解 ...

  6. 使用yum命令报错File "/usr/bin/yum", line 30 except KeyboardInterrupt, e:

    背景: yum包的管理是使用python写的,有对应的python版本   遇到的问题报错如下: File "/usr/bin/yum", line 30     except K ...

  7. python升级带来的yum异常:File "/usr/bin/yum", line 30

    问题: $ yum File "/usr/bin/yum", line 30 except KeyboardInterrupt, e: ^ SyntaxError: invalid ...

  8. python升级3.6后 yum出错File "/usr/bin/yum", line 30 ^

    问题描述: # yum provides ifconfig File "/usr/bin/yum", line 30 except KeyboardInterrupt, e: ^ ...

  9. 树莓派(Raspberry Pi 3) centos7使用yum命令报错File "/usr/bin/yum", line 30 except KeyboardInterrupt, e:

    使用yum命令报错 File "/usr/bin/yum", line 30 except KeyboardInterrupt, e: ^SyntaxError: invalid ...

随机推荐

  1. How to Get Vertical Line from Point and Line

    Description How to get vertical line cross one point which out of line in line. QPoint Line::Vertica ...

  2. java同一个类中,构造器如何调用另一个重载的构造器?

    构造器里面调用其它构造器,格式方法如下:1.使用this调用另一个重载构造器,只能在构造器中使用:2.必须写在构造器执行体的第一行语句: 示例如下: import static java.lang.S ...

  3. ToList和ToDataTable(其中也有反射的知识)

    using System;using System.Collections.Generic;using System.Data;using System.Linq;using System.Refle ...

  4. 职责链模式c#(处理车)

    using System;using System.Collections.Generic;using System.Linq;using System.Text; namespace 职责链模式{  ...

  5. JAVA定时关机小程序

    大一刚学java时候做的小程序.由于当时迅雷还没有下载完成关机,晚上要下很多学习资料.只有自己算时间然后通过shutdown命令设置时间关机. 当时通过shutwodn命令,想到能否通过java做一个 ...

  6. centos7 redis伪集群安装

    安装gcc: yum install gcc -y   上传redis软件包到 /home下   解压: tar xf redis-3.2.11.tar.gz   进入 redis 目录 : cd r ...

  7. 如何用Python实现常见机器学习算法-4

    四.SVM支持向量机 1.代价函数 在逻辑回归中,我们的代价为: 其中: 如图所示,如果y=1,cost代价函数如图所示 我们想让,即z>>0,这样的话cost代价函数才会趋于最小(这正是 ...

  8. idea如何设置注释作者信息

    什么情况下使用? 在建一个新的类的时候   有注释信息  如下图所示 实现步骤 1  打开idea后   点击File后 选择Settings..如下图 2 打开后打开 file and code t ...

  9. WAMP不能启动, 一直处于红色图标或者橙色图标的解决办法

    WAMP不能启动, 一直处于红色图标(正常启动为绿色吧) 考虑是端口的问题,我找到wamp文件夹中的wamp\bin\apache\apache2.2.22\conf路径下的httpd.conf文件, ...

  10. 前端传递对象列表到WebApi

    public Int64 objectPOC(JObject jsonWrapper) { dynamic jsonValues = jsonWrapper; JArray jsonInput = j ...