gpt4 book ai didi

python - 如何删除我的 anaconda 环境?

转载 作者:太空宇宙 更新时间:2023-11-03 13:57:51 34 4
gpt4 key购买 nike

我在 Mac OS X 中工作。我创建了一个名为 python2env 的 conda 环境。您可以在这里看到它:

conda info --envs
# conda environments:
#
python2env /Users/user/anaconda/envs/python2env
..
root * /Users/user/anaconda

我尝试了以下命令来删除它:

conda env remove --name python2env

Remove all packages in environment /Users/user/anaconda/envs/python2env:

Proceed ([y]/n)? y

然后,我检查它是否已被删除:

conda info --envs
# conda environments:
#
python2env /Users/user/anaconda/envs/python2env
..
root * /Users/user/anaconda

但它仍然在那里!

我尝试了conda remove --name python2env --all但无济于事。环境仍然列出。

如何删除我的 Anaconda 环境?

更新,jentjr 的 avdvice:

~ conda remove --name python2env --all --debug

DEBUG conda.gateways.disk.test:prefix_is_writable(65): testing write access for prefix '/Users/user/anaconda' using path '/Users/user/anaconda/conda-meta/history'
DEBUG conda.gateways.disk.test:prefix_is_writable(65): testing write access for prefix '/Users/user/anaconda' using path '/Users/user/anaconda/conda-meta/history'

Remove all packages in environment /Users/user/anaconda/envs/python2env:

Proceed ([y]/n)? y

DEBUG conda.gateways.disk.permissions:make_writable(36): tried make writable but failed: /Users/user/anaconda/envs/python2env/static/css/img/igv_logo_letters_paths.svg
PermissionError(1, 'Operation not permitted')

~ conda remove -p /Users/user/anaconda/envs/python2env --all --debug
DEBUG conda.gateways.disk.test:prefix_is_writable(65): testing write access for prefix '/Users/user/anaconda' using path '/Users/user/anaconda/conda-meta/history'

Remove all packages in environment /Users/user/anaconda/envs/python2env:

Proceed ([y]/n)? y

DEBUG conda.gateways.disk.permissions:make_writable(36): tried make writable but failed: /Users/user/anaconda/envs/python2env/static/css/img/igv_logo_letters_paths.svg
PermissionError(1, 'Operation not permitted')
INFO conda.gateways.disk.delete:rm_rf(59): rm_rf failed for /Users/user/anaconda/envs/python2env

使用 --debug 或指定环境的完整路径都无法将其删除。我将尝试使用 chmod 使环境可写,然后重试并更新我的帖子。

最佳答案

环境目录中的 conda-meta 文件夹也存在类似问题,并使用 rm -rf [full-path-to-conda-env] 解决了该问题。

关于python - 如何删除我的 anaconda 环境?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49470454/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com