python3.7安装ipython_ipython3在python3.7的终端中不起作用

I recently upgraded from Python3.6 to Python3.7. Since I have upgraded, when I type in ipython3 in the terminal I get an error:

~$ ipython3

Traceback (most recent call last):

File "", line 1, in

File "/usr/lib/python3/dist-packages/IPython/__init__.py", line 48, in

from .core.application import Application

File "/usr/lib/python3/dist-packages/IPython/core/application.py", line 25, in

from IPython.core import release, crashhandler

File "/usr/lib/python3/dist-packages/IPython/core/crashhandler.py", line 28, in

from IPython.core import ultratb

File "/usr/lib/python3/dist-packages/IPython/core/ultratb.py", line 124, in

from IPython.utils import path as util_path

File "/usr/lib/python3/dist-packages/IPython/utils/path.py", line 18, in

from IPython.utils.process import system

File "/usr/lib/python3/dist-packages/IPython/utils/process.py", line 19, in

from ._process_posix import system, getoutput, arg_split, check_pid

File "/usr/lib/python3/dist-packages/IPython/utils/_process_posix.py", line 24, in

import pexpect

File "/usr/lib/python3/dist-packages/pexpect/__init__.py", line 75, in

from .pty_spawn import spawn, spawnu

File "/usr/lib/python3/dist-packages/pexpect/pty_spawn.py", line 14, in

from .spawnbase import SpawnBase

File "/usr/lib/python3/dist-packages/pexpect/spawnbase.py", line 224

def expect(self, pattern, timeout=-1, searchwindowsize=-1, async=False):

^

SyntaxError: invalid syntax

Furthermore I have noticed that my jupyter-notebook does not seem to work with the python3 kernel now as well (I get the kernel dead error).

NOTEs:

ipython and jupyter-notebook are working with fine when I use them with Python2.

I am using Ubuntu 18.04 (Bionic Beaver) although I don't think this is relevant

解决方案

UPDATE Please update your installed packages.

This error for pexpect has been reported and closed already issue

In Python 3.7, async and await are now reserved keywords. This is what is breaking some of your installed packages.

If you do not need the new features in 3.7, roll back to 3.6 and wait until your packages are updated to support the new syntax in 3.7

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值