![]() Instead, my final recommendation concurs with what suggested, namely, use conda clean -p to delete unused packages, but keep the cache ( pkgs dir) so that future environments can still leverage hardlinks. In particular, I think it worth emphasizing that deleting the pkgs directory may not actually achieve what OP was hoping for (to save space) and that removing the package cache undermines Conda's redundancy minimization strategy going forward by making it impossible to share already installed packages. Nevertheless, I do believe some of what I raised still has some merit for this thread, and so I am deciding to retain the answer with amendments. My apologies for the misleading response. Personally, I use this option without issues.Īfter reviewing the documentation pointed out in answer, I must admit my initial response was overly alarmist and, in parts, blatantly incorrect. If you don't use environments or use Anaconda under Windows, you're probably safe. To more aggressively save space you can use conda clean -force-pkgs-dirs to remove all writable package caches (with the same caveat that there could be environments linked to these dirs). I guess that's why conda clean -packages is included in conda clean -all. While this does not check for packages installed using symlinks back to the package cache, this is not a topic if you don't use such environments or work under Windows. However, when creating new environments, it is more efficient to leave whatever packages are in the cache around."Īccording to the documentation you can use conda clean -packages to remove unused packages in pkgs (which will move them to pkgs/.trash from which you can then safely delete them). You can remove it completely is you want to. As stated here by Anaconda Community Support "the pkgs directory is only a cache. No packages found in C:\Users\some_user\.conda\envs\myenv.Actually, under certain conditions it is an option to have the pkgs subdirs removed. Remove all packages in environment C:\Users\some_user\.conda\envs\myenv: PS C:\Users\some_user> conda remove -name myenv -all When you remove an environment, it means you permanently remove environment and all the packages belong to that environment from the computer. ![]() When you switch or deactivate from an environment, those packages specific to that environment will not be accessible from powershell. ![]() When you are within an environment, the packages within that environment can be accessible. How packages can set arbitrary environment variables that may be Scripts that the environment may contain. Activation entails two primary functions:Īdding entries to PATH for the environment and running any activation (base) PS C:\Users\some_user> conda deactivateĪctivating environments is essential to making the software in theĮnvironments work well. (myenv) PS C:\Users\some_user> conda deactivate Now when you deactivate myenv it will go back to base environment. ![]() (base) PS C:\Users\some_user> conda activate myenv If you want to switch to another environment you could simply type: conda activate myenv within the base environment. Now you are in the base environment which comes default with conda. Then if you type conda activate base you will see the following line: (base) PS C:\Users\some_user When you open the powershell, you will be on the default powershell window: PS C:\Users\some_user>
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |