Using PyCharm I've created a project with a conda interpreter. Pycharm automatically creates a conda environment for it. Short after, I realized I wanted another location for the project. Thus I removed the project folder. Then I realized I want to delete the conda environment.
So first I verify that the environment is there.
(base) C:\Users\Ludvig>conda env list
WARNING: The conda.compat module is deprecated and will be removed in a future release.
WARNING: The conda.compat module is deprecated and will be removed in a future release.
# conda environments:
#
base * C:\Users\Ludvig\Anaconda3
2019 Proteinanalys C:\Users\Ludvig\Anaconda3\envs\2019 Proteinanalys
Then I try to remove it.
(base) C:\Users\Ludvig>conda env remove --name "2019 Proteinanalys"
WARNING: The conda.compat module is deprecated and will be removed in a future release.
WARNING: The conda.compat module is deprecated and will be removed in a future release.
CondaValueError: Invalid environment name: '2019 Proteinanalys'
Characters not allowed: ('/', ' ', ':')
Any thoughts on how to delete this environment?
Try specifying the path using the --prefix
flag instead:
conda env remove --prefix "C:\Users\Ludvig\Anaconda3\envs\2019 Proteinanalys"
or, similarly,
conda remove --all --prefix "C:\Users\Ludvig\Anaconda3\envs\2019 Proteinanalys"
The reason why this works is because the error you encounter occurs as part of the code that attempts resolve a prefix path using the name. If you specify the path directly, then it doesn't have to run this resolve branch of the code.
It should be conda remove --all --prefix "path"
(i.e. remove should be without --
), else it shows the following error (at least in my case):
conda: error: argument command: invalid choice: 'path'
(choose from 'clean', 'config', 'create', 'help', 'info', 'install', 'list', 'package', 'remove', 'uninstall', 'search', 'update', 'upgrade')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With