ipython3在python3.7的终端中不起作用 [英] ipython3 does not work in the terminal with python3.7

查看:398
本文介绍了ipython3在python3.7的终端中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近从Python3.6升级到Python3.7.由于我已经升级,因此在终端中输入ipython3时出现错误:

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 "<string>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/IPython/__init__.py", line 48, in <module>
    from .core.application import Application
  File "/usr/lib/python3/dist-packages/IPython/core/application.py", line 25, in <module>
    from IPython.core import release, crashhandler
  File "/usr/lib/python3/dist-packages/IPython/core/crashhandler.py", line 28, in <module>
    from IPython.core import ultratb
  File "/usr/lib/python3/dist-packages/IPython/core/ultratb.py", line 124, in <module>
    from IPython.utils import path as util_path
  File "/usr/lib/python3/dist-packages/IPython/utils/path.py", line 18, in <module>
    from IPython.utils.process import system
  File "/usr/lib/python3/dist-packages/IPython/utils/process.py", line 19, in <module>
    from ._process_posix import system, getoutput, arg_split, check_pid
  File "/usr/lib/python3/dist-packages/IPython/utils/_process_posix.py", line 24, in <module>
    import pexpect
  File "/usr/lib/python3/dist-packages/pexpect/__init__.py", line 75, in <module>
    from .pty_spawn import spawn, spawnu
  File "/usr/lib/python3/dist-packages/pexpect/pty_spawn.py", line 14, in <module>
    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

此外,我已经注意到,我的jupyter-notebook似乎现在也不适用于python3内核(我得到了内核死错误).

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).

注意:

  • 当我将它们与Python2配合使用时,ipython和jupyter-notebook可以很好地工作.
  • 我正在使用Ubuntu 18.04(Bionic Beaver),尽管我认为这无关紧要

推荐答案

更新请更新您已安装的软件包. 已报告并报告了pexpect的错误,并已问题

UPDATE Please update your installed packages. This error for pexpect has been reported and closed already issue

在Python 3.7中,asyncawait现在是保留关键字.这就是破坏您已安装的某些软件包的原因.

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

如果您不需要3.7中的新功能,请回滚至3.6,然后等待软件包更新以支持3.7中的新语法.

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

Python 3.7的新增功能

这篇关于ipython3在python3.7的终端中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆