The problem:
I have installed Anaconda:
conda -V
conda 4.4.7
Also I installed a lot of packages for it using pyt
One has to be careful when using pip inside a conda environment, whether for installing and unistalling packages. What works for me is based on https://stackoverflow.com/a/43729857/1047213.
pip
that is specific to the conda environment by running conda install pip
inside the conda environment.pip
while installing or uninstalling a package. Usually, you will find it inside the bin
folder of the virtual environment (e.g., /anaconda/envs/venv_name/bin/
). Thus, the following works for me: /anaconda/envs/venv_name/bin/pip install_or_uninstall package_name
.If you installed the package using setup.py
, then you will most likely have to delete the package files manually.
You'd find the Uninstalling setup.py install wiki useful. Unix instructions quoted below:
sudo python setup.py install --record files.txt
# inspect files.txt to make sure it looks ok. Then in bash:
tr '\n' '\0' < files.txt | xargs -0 sudo rm -f --
You can use Jupyter Notebook to solve this problem :
!pip uninstall -y [package]
in a code cell