[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?

This question is related to python pip anaconda conda

The answer is


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

Examples related to python

programming a servo thru a barometer Is there a way to view two blocks of code from the same file simultaneously in Sublime Text? python variable NameError Why my regexp for hyphenated words doesn't work? Comparing a variable with a string python not working when redirecting from bash script is it possible to add colors to python output? Get Public URL for File - Google Cloud Storage - App Engine (Python) Real time face detection OpenCV, Python xlrd.biffh.XLRDError: Excel xlsx file; not supported Could not load dynamic library 'cudart64_101.dll' on tensorflow CPU-only installation

Examples related to pip

How to fix error "ERROR: Command errored out with exit status 1: python." when trying to install django-heroku using pip "E: Unable to locate package python-pip" on Ubuntu 18.04 How to Install pip for python 3.7 on Ubuntu 18? What is the meaning of "Failed building wheel for X" in pip install? Could not install packages due to an EnvironmentError: [Errno 13] How do I install Python packages in Google's Colab? Conda version pip install -r requirements.txt --target ./lib pip: no module named _internal AttributeError: Module Pip has no attribute 'main' Error after upgrading pip: cannot import name 'main'

Examples related to anaconda

Upgrade to python 3.8 using conda Updating Anaconda fails: Environment Not Writable Error Jupyter Notebook not saving: '_xsrf' argument missing from post Conda version pip install -r requirements.txt --target ./lib How to check python anaconda version installed on Windows 10 PC? Anaconda / Python: Change Anaconda Prompt User Path How to access Anaconda command prompt in Windows 10 (64-bit) Conda activate not working? update to python 3.7 using anaconda Tensorflow import error: No module named 'tensorflow'

Examples related to conda

Upgrade to python 3.8 using conda How do I prevent Conda from activating the base environment by default? Conda version pip install -r requirements.txt --target ./lib Removing Conda environment PackagesNotFoundError: The following packages are not available from current channels: Conda activate not working? ModuleNotFoundError: No module named 'sklearn' How do I update Anaconda? Conda command is not recognized on Windows 10 'Conda' is not recognized as internal or external command