The message you're seeing, PackagesNotFoundError, suggests that conda didn't find the packages cudatoolkit and cudnn in your current environment (which is the base environment in this case). This could happen for a few reasons:
-
The packages are not installed: It's possible that the packages were not successfully installed in the first place or were installed in a different environment. You can double-check which packages are installed in your current environment by running:
conda list
This will give you a list of all packages installed in the current environment. If cudatoolkit and cudnn do not appear in this list, they are indeed not installed in your base environment.
-
Installation in a different environment: If you installed these packages in a different conda environment, you need to switch to that environment using conda activate <environment_name> before you can remove them. Only the packages installed in the currently active environment can be removed.
-
Installation by another package manager: If you didn't use conda to install these packages (e.g., if you used pip for some part of your setup), conda wouldn't be able to remove them. However, since you mentioned installing them via conda, this is less likely the case unless you mistakenly used a different method later on.
To troubleshoot, you can try the following steps:
-
Ensure you're working in the correct environment: If you might have installed the packages in a different environment, switch to it using conda activate <environment_name> and then try the removal process again.
-
Check installed packages: In the environment you believe you installed cudatoolkit and cudnn, run conda list to confirm their presence.
-
Use a broader remove command (optional): If you're sure you want to remove these packages and any related dependencies, and if they're present but perhaps installed under slightly different names or versions, you could try a more general removal command without specifying versions:
conda remove cudatoolkit cudnn -n <environment_name>
Replace <environment_name> with the name of your target environment if you're not working in the base environment.
-
Consider environment-specific issues: If you're in the correct environment and still facing issues, there could be an issue with the environment itself. Creating a new environment and reinstalling your necessary packages there might be a workaround if specific environment corruption occurred.
If you verified that the packages were installed and still face issues with conda remove, checking for typos or version-specific naming discrepancies might be helpful, or you might explore reinstalling conda if the issue persists across multiple environments or packages.