Conda - unable to completely delete environment

2024/11/14 16:20:07

I am using Windows 10 (all commands run as administrator). I created an environment called myenv. Then I used

conda env remove -n myenv

Now, if I try

conda info --envs

I only see the base environment. However, if I try

conda activate myenv

I'm still able to activate it! I think because under the folder envs, there is still a folder with the name myenv there which doesn't get deleted.

How do I delete the environment for good?

Answer

Command-line options can only go so far, unless you get very specific; perhaps the simplest approach is to delete things manually:

  1. Locate Anaconda folder; I'll use "D:\Anaconda\"
  2. In envs, delete environment of interest: "D:\Anaconda\envs\myenv"

Are you done? Not quite; even while in myenv, conda will still sometimes install packages to the base environment, in "D:\Anaconda\pkgs\"; thus, to clean traces of myenv,

  1. Delete packages installed to myenv that ended up in "D:\Anaconda\pkgs\"

  2. (If above don't suffice) Anaconda Navigator -> Environments -> myenv -> Remove

  3. (If above don't suffice) Likely corrupted Anaconda; make note of installed packages, completely uninstall Anaconda, reinstall.

Note: step 3 is redundant for the goal of simply removing myenv, but it's recommended to minimize future package conflicts.

https://en.xdnf.cn/q/71995.html

Related Q&A

How to list all function names of a Python module in C++?

I have a C++ program, I want to import a Python module and list all function names in this module. How can I do it?I used the following code to get the dict from a module:PyDictObject* pDict = (PyDict…

Pandas groupby and sum total of group

I have a Pandas DataFrame with customer refund reasons. It contains these example data rows:**case_type** **claim_type** 1 service service 2 service service 3 charg…

Capture webcam video using PyQt

Given the following PyQt code, I can perfectly capture the webcams streaming video. Now, I want to modify code, so a button named capture button is added that once pressed captures the streaming video …

Plot a 3d surface from a list of lists using matplotlib

Ive searched around for a bit, and whhile I can find many useful examples of meshgrid, none shhow clearly how I can get data from my list of lists into an acceptable form for any of the varied ways Ive…

Super fast way to compare if two strings are equal

Obviously, in Python to check whether two strings are equal you can do:"hello word" == "hello world"But what if you are comparing really long strings (in excess of 1m characters)? …

Pandas DataFrames in reportlab

I have a DataFrame, and want to output it to a pdf. Im currently trying to use ReportLab for this, but it wont seem to work. I get an error here:mytable = Table(make_pivot_table(data, pivot_cols, colum…

How to open and close a website using default browser with python

Im trying to write a python script on windows platform to open a webpage(such as Google), and then, after 10 seconds, close this website. Note: Im using Windows 7, Python 2.7.10, and IE

Comparing numpy array with itself by element efficiently

I am performing a large number of these calculations:A == A[np.newaxis].Twhere A is a dense numpy array which frequently has common values.For benchmarking purposes we can use:n = 30000 A = np.random.r…

Kivy: BoxLayout vs. GridLayout

BoxLayout(orientation=vertical) vs. GridLayout(cols=1):They both do the same thing, no? Is there a reason to choose one over the other?

Flask circular dependency

I am developing a Flask application. It is still relatively small. I had only one app.py file, but because I needed to do database migrations, I divided it into 3 using this guide:https://realpython.co…