You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

在Jupyter Notebook安装jovian时遇AttributeError报错求助

在Jupyter Notebook安装jovian时遇到AttributeError问题

我是Python新手,尝试在Jupyter Notebook中使用命令!pip install jovian --upgrade安装jovian,但出现以下报错:

AttributeError                            Traceback (most recent call last)
Cell In[1], line 1
----> 1 get_ipython().system('pip install jovian --upgrade')

File /lib/python3.11/site-packages/IPython/core/interactiveshell.py:2590, in InteractiveShell.system_piped(self, cmd)
2585     raise OSError("Background processes not supported.")
2587 # we explicitly do NOT return the subprocess status code, because
2588 # a non-None value would trigger :func:`sys.displayhook` calls.
2589 # Instead, we store the exit_code in user_ns.
-> 2590 self.user_ns['_exit_code'] = system(self.var_expand(cmd, depth=1))

File /lib/python3.11/site-packages/IPython/utils/_process_posix.py:129, in ProcessHandler.system(self, cmd)
125 enc = DEFAULT_ENCODING
127 # Patterns to match on the output, for pexpect.  We read input and
128 # allow either a short timeout or EOF
-> 129 patterns = [pexpect.TIMEOUT, pexpect.EOF]
130 # the index of the EOF pattern in the list.
131 # even though we know it's 1, this call means we don't have to worry if
132 # we change the above list, and forget to change this value:
133 EOF_index = patterns.index(pexpect.EOF)

AttributeError: module 'pexpect' has no attribute 'TIMEOUT'

解决方法

  • 先修复pexpect模块:该报错源于pexpect版本不兼容或安装损坏,运行以下命令强制重新安装:
    !pip install --force-reinstall pexpect
    
  • 修复完成后,再次执行jovian安装命令:
    !pip install jovian --upgrade
    
  • 若上述方法无效,可尝试用conda安装(需已配置conda环境):
    !conda install -c conda-forge jovian
    
  • 也可直接在终端(Jupyter Notebook外部)执行安装命令,绕开Notebook的shell交互问题:
    pip install jovian --upgrade
    

内容的提问来源于stack exchange,提问作者Ankita Bhattacharjee

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.11 18:33:25