conda 卡在 Proceed ([y]/n) 上?在 ipython 控制台中更新包时

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/39826250/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-19 22:46:17  来源:igfitidea点击:

conda stuck on Proceed ([y]/n)? when updating packages in ipython console

pythonipythonanacondaspydergraphlab

提问by Aby

I just downloaded Anaconda 4.2.0 (with python 3.5.2) for Mac OS X. Whenever I try to update any packages etc, my ipython console presents the package dependencies and displays "Proceed ([y]/n)?" but does not take any inputs. E.g. I press enter, or y-enter etc. and nothing happens. Here's an example:

我刚刚为 Mac OS X 下载了 Anaconda 4.2.0(带有 python 3.5.2)。每当我尝试更新任何包等时,我的 ipython 控制台都会显示包依赖项并显示“Proceed ([y]/n)?” 但不接受任何输入。例如,我按 Enter 或 y-enter 等,但没有任何反应。下面是一个例子:

!conda create -n graphlab-env python=2.7 anaconda
Fetching package metadata .......
Solving package specifications: ..........

Package plan for installation in environment /Users/Abhijit/anaconda/envs/graphlab-env:

The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    python-2.7.12              |                1         9.5 MB
    _license-1.1               |           py27_1          80 KB
    alabaster-0.7.9            |           py27_0          11 KB
    anaconda-clean-1.0.0       |           py27_0           3 KB
.
.
.
    nbpresent-3.0.2            |           py27_0         463 KB
    anaconda-4.2.0             |      np111py27_0           6 KB
    ------------------------------------------------------------
                                           Total:       143.9 MB

The following NEW packages will be INSTALLED:

    _license:           1.1-py27_1         
    _nb_ext_conf:       0.3.0-py27_0       
    alabaster:          0.7.9-py27_0       
    anaconda:           4.2.0-np111py27_0  
    anaconda-clean:     1.0.0-py27_0       
.
.
.
    yaml:               0.1.6-0            
    zlib:               1.2.8-3            

Proceed ([y]/n)? 

It won't respond after this step. When I enter 'Ctrl-C' it breaks out of this loop. I have tried Shift-Enter, Alt-Enter, Ctrl-Enter, Cmd-Enter etc but no luck. Tearing my hair out over this. Am I missing something?

这一步之后就没有反应了。当我输入 'Ctrl-C' 时,它会跳出这个循环。我尝试过 Shift-Enter、Alt-Enter、Ctrl-Enter、Cmd-Enter 等,但没有运气。把我的头发扯掉了。我错过了什么吗?

回答by Paul H

You can launch shell commands with the !operator in ipython, but you can't interact with them after the process has launched.

您可以!在 ipython 中使用操作符启动 shell 命令,但在进程启动后您无法与它们交互。

Therefore, you could:

因此,您可以:

  1. execute your conda command outside of your ipython session (IOW, a normal shell); or
  2. pass the --yesflag. e.g.:
  1. 在你的 ipython 会话之外执行你的 conda 命令(IOW,一个普通的 shell);或者
  2. 传递--yes旗帜。例如:

In[2]: !conda create -n graphlab-env python=2.7 anaconda --yes

In[2]: !conda create -n graphlab-env python=2.7 anaconda --yes

回答by aroma

If you add a '--yes' at the end of the command it works. For example:

如果您在命令末尾添加“--yes”,它会起作用。例如:

>>>!conda install seaborn --yes

回答by Karan Sharma

Just Append -y to any command to skip all the yes/no questions. Most of the packages are configured in a way to work with this. For your !conda create -n graphlab-env python=2.7 anaconda -y

只需将 -y 附加到任何命令即可跳过所有是/否问题。大多数软件包都以某种方式进行配置以处理此问题。对于你的 !conda create -n graphlab-env python=2.7 anaconda -y

回答by Bia Ch

Solution: !conda update --all --yes

解决方案:!conda update --all --yes