Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
221 views
in Technique[技术] by (71.8m points)

python - Conda uninstall one package and one package only

When I try to uninstall pandas from my conda virtual env, I see that it tries to uninstall more packages as well:

$ 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 pandas only and not have anything else downgraded.

I understand that there these packages have dependencies to pandas and even to specific versions of pandas, but is this even possible at all with conda?

Partial motivation

My understanding is that it isn't that easy to 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.

Since I want to use the version in master, my plan is to uninstall the conda version and use pip to install pandas from master on the official repo GitHub.

How can I do this?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You can use 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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...