添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
不拘小节的皮带  ·  规划发展·  3 周前    · 
勤奋的长颈鹿  ·  DJI大疆社区·  2 月前    · 

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement . We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On Windows 7 using conda 1.7.2, I see that it deletes the packages, but there is a Lib/ directory remaining in the environment directory and hence the environment directory is not removed as well.

FWIW, I created the environment using: conda create -n python3 python=3 matplotlib

and removed it using conda remove -n python3 --all

Hey, I got the same problem, you may need to run in sudo mode to get the folder deleted.

Here is my sample, I run

conda env remove --name myenvname

then I run

conda env list

I still saw the myenvname appears in the list. I tried

sudo conda env remove --name myenvname

It worked!

same problem.
Win10, conda 4.8.5

i tried the two commands below (also as administrator). The environment seems to be removed but the directory still exists and is activateable (bigger problem).
conda remove -n --all
conda env remove -n

edit:
conda 4.9.2
The removal of the env-dir only works from the same cmd-shell as the one used for creation

@asmeurer this might need to be reopened. I suspect there may be some side effect of conda becoming a batch script (conda.bat). One thing that comes to mind with .bat scripts is if you execute one script from another without using the "call" keyword the calling script will immediately exit. Conda.bat is first on the PATH, so chances are it gets invoked from within itself under some circumstances?

(dev37) C:\Users\volex>where conda
C:\Users\volex\AppData\Local\Continuum\anaconda3\condabin\conda.bat
(dev37) C:\Users\volex>dir C:\Users\volex\AppData\Local\Continuum\anaconda3\Scripts\conda.*
 Volume in drive C is Local Disk
 Volume Serial Number is 1AA7-F49F
 Directory of C:\Users\volex\AppData\Local\Continuum\anaconda3\Scripts
11/10/2020  06:08 PM            74,752 conda.exe
08/07/2020  04:05 AM            74,752 conda.exe.c~.conda_trash
               2 File(s)        149,504 bytes
               0 Dir(s)  38,567,014,400 bytes free

@asmeurer this might need to be reopened. I suspect there may be some side effect of conda becoming a batch script (conda.bat). One thing that comes to mind with .bat scripts is if you execute one script from another without using the "call" keyword the calling script will immediately exit. Conda.bat is first on the PATH, so chances are it gets invoked from within itself under some circumstances?

(dev37) C:\Users\volex>where conda
C:\Users\volex\AppData\Local\Continuum\anaconda3\condabin\conda.bat
(dev37) C:\Users\volex>dir C:\Users\volex\AppData\Local\Continuum\anaconda3\Scripts\conda.*
 Volume in drive C is Local Disk
 Volume Serial Number is 1AA7-F49F
 Directory of C:\Users\volex\AppData\Local\Continuum\anaconda3\Scripts
11/10/2020  06:08 PM            74,752 conda.exe
08/07/2020  04:05 AM            74,752 conda.exe.c~.conda_trash
               2 File(s)        149,504 bytes
               0 Dir(s)  38,567,014,400 bytes free

I agree with this comment, the issue persists for me and I would like to re-open (I'm new here, maybe I should start a new issue?).

I try to delete environment, it doesn't show up in list of environments, but I can still activate it so it is definitely there. However, when activating, it says conda.bat activate myenv and then opens the environment.

Anyone have advice on how I can fully delete this environment?

@asmeurer this might need to be reopened. I suspect there may be some side effect of conda becoming a batch script (conda.bat). One thing that comes to mind with .bat scripts is if you execute one script from another without using the "call" keyword the calling script will immediately exit. Conda.bat is first on the PATH, so chances are it gets invoked from within itself under some circumstances?

(dev37) C:\Users\volex>where conda
C:\Users\volex\AppData\Local\Continuum\anaconda3\condabin\conda.bat
(dev37) C:\Users\volex>dir C:\Users\volex\AppData\Local\Continuum\anaconda3\Scripts\conda.*
 Volume in drive C is Local Disk
 Volume Serial Number is 1AA7-F49F
 Directory of C:\Users\volex\AppData\Local\Continuum\anaconda3\Scripts
11/10/2020  06:08 PM            74,752 conda.exe
08/07/2020  04:05 AM            74,752 conda.exe.c~.conda_trash
               2 File(s)        149,504 bytes
               0 Dir(s)  38,567,014,400 bytes free

I'm having the same issue.

I have the same issue (Windows 10). The remaining files in the env are exclusively *.conda_trash files. All of them are locked by a process and thus I cannot delete them before logging out/in. With my limited rights on this cooperate PC, I don't know how to find the specific process that locks them. There is no obvious candidate (like python or conda) that I can see.

I have the same issue (Windows 10). The remaining files in the env are exclusively *.conda_trash files. All of them are locked by a process and thus I cannot delete them before logging out/in. With my limited rights on this cooperate PC, I don't know how to find the specific process that locks them. There is no obvious candidate (like python or conda) that I can see.

I solve this problem by close all processes related to python & Anaconda. Maybe there are some programs based on Python on your computer are still running?

I had the same issue.
First, you can make sure that all your python processes are not working in your environment. Then you can try to remove the environment using: conda remove -n <env> --all or conda env remove --name <env>
Or, try removing the environment by specifying the complete path: conda env remove -p <complete_path _env>

I am not sure what is the problem with conda, but one of these combinations should work.

Hi all,

I was facing the same problem on Win10 running conda 4.10.3. When I tried to delete the envs manually by going into the conda directory (C:/Users/User/miniconda/env) it was unable to delete it because two processes were using it in background (gszerver and Python in my case).

I solved it by looking up these processes in Task Manager and manually killing them.

I had this problem on many environments in Windows 10 and I did this from CMD:
del /s c:\miniconda\envs<env name>*.*

After responding Y to all the prompts, I was able to delete the folder with the following command in cmd:
rd c:\miniconda\envs<env name>

And also with this command in python:
import shutil; shutil.rmtree("c:\miniconda\envs\")

For those who can't find a name or have the same name env for every environment they've created then you need to execute this command to remove the conda env from a specific directory

conda remove --prefix /path/to/conda-env/ --all

I solved it by looking up these processes in Task Manager and manually killing them.

On Windows, you must use the Resource Monitor to find what process you need to kill .

Quoting a response from StackExchange:

You can use the Resource Monitor for this which comes built-in with Windows 7, 8, 10 and 11!
    Open Resource Monitor, which can be found
        By searching for Resource Monitor or resmon.exe in the start menu, or
        As a button on the Performance tab in your Task Manager
    Go to the CPU tab
    Use the search field in the Associated Handles section
        See blue arrow in screen shot below
When you've found the handle, you can identify the process by looking at the Image and/or PID column.
You can then try to close the application as you normally would, or, if that's not possible, just right-click the handle 
and kill the process directly from there. Easy peasy!

Source: https://superuser.com/a/643312