I tried installing rpy2 so that I could work with R files (.rda
) using conda install -c r rpy2
, and it totally screwed up my environment.
For example:
1) When I try importing pandas, I get this error: AttributeError: module 'pandas' has no attribute 'core'
2) When I try importing matplotlib, I get this error: AttributeError: module 'matplotlib' has no attribute 'artist'
I wasn't having these issues before I installed this package. Is there a way to undo what I just did - as if I never installed it in the first place?
If you want to revert to a previous revision you can simply run conda install --revision N (where N is the revision number). This will ask you to confirm the relevant package uninstallation/installation – and get you back to exactly where you were before!
The fix is to use the ./bin/conda executable in the conda git repository to force reinstall conda. That is, run ./bin/conda install -f conda . You can then verify with conda info that you have the latest version of conda, and not a git checkout.
Remove your environment You can use conda env remove to remove the environment. Same thing as create, you have to specify the name of the environment you wish to remove by using --name .
If you want to switch to another environment you could simply type: conda activate myenv within the base environment. Now when you deactivate myenv it will go back to base environment. When you are within an environment, the packages within that environment can be accessible.
You can "roll back" to a previous revision. First, run:
conda list --revisions
You will get a list of revisions with their revision number. Then, look at the second-to-last revision and take note of its number. To revert to this revision, run:
conda install --revision N
where N
is the revision number.
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