Python Conda 卸载一包,只卸载一包

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/38459186/
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 20:48:15  来源:igfitidea点击:

Conda uninstall one package and one package only

pythonpipanacondaconda

提问by Amelio Vazquez-Reina

When I try to uninstall pandasfrom my condavirtual env, I see that it tries to uninstall more packages as well:

当我尝试pandas从我的conda虚拟环境中卸载时,我看到它也尝试卸载更多的包:

$ conda uninstall pandas
Using Anaconda Cloud api site https://api.anaconda.org
Fetching package metadata: ....
Solving package specifications: .........

Package plan for package removal in environment /Users/amelio/anaconda/envs/py35:

The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    dask-0.7.6                 |           py35_0         276 KB

The following packages will be REMOVED:

    blaze:       0.10.1-py35_0
    odo:         0.5.0-py35_1
    pandas:      0.18.1-np111py35_0
    seaborn:     0.7.0-py35_0
    statsmodels: 0.6.1-np111py35_1

The following packages will be DOWNGRADED:

    dask:        0.10.1-py35_0      --> 0.7.6-py35_0

Proceed ([y]/n)?

I would like to uninstall pandasonlyand not have anything else downgraded.

我想卸载pandas和没有别的降级。

I understand that there these packages have dependenciesto pandasand even to specific versionsof pandas, but is this even possible at all with conda?

我知道这些包依赖pandas甚至特定版本的熊猫,但这甚至可能conda吗?

Partial motivation

部分动机

My understanding is that it isn't that easyto install a package from GitHub using conda. At least it isn't as easy as using a one-liner as one can do with pip.

我的理解是,它不是那么容易使用安装从GitHub包conda。至少它不像使用 one-liner 那样容易,就像使用pip.

Since I want to use the version in master, my plan is to uninstall the condaversion and use pipto install pandasfrom master on the official repo GitHub.

由于我想使用 中的版本master,我的计划是卸载该conda版本并用于从官方 repo GitHub 上的 masterpip安装pandas

How can I do this?

我怎样才能做到这一点?

回答by Edison Gustavo Muenz

You can use conda remove --force.

您可以使用conda remove --force.

The documentation says:

文档说:

--force               Forces removal of a package without removing packages
                      that depend on it. Using this option will usually
                      leave your environment in a broken and inconsistent
                      state