Editing code in answers1, except to fix obvious typos, is discouraged by a portion of the community. This premise is based on the idea that you are changing someone's work to something that it isn't, and that person, not you, will feel the impact (in terms of downvotes) if your edit is not correct. Because of this, many reviewers will reject almost all edits that change the code of an answer regardless of the reason, whether they are not familiar with the topic or not.
The flip side is there is a sizable minority that thinks this practice is acceptable and proper.
So you can say that it is, at best, a disputed practice.
The best practice in most of these cases unless you want to deal with the likely potential of rejected edits is to leave a comment and let the original author make the change, or adding your own answer. If the code isn't working, then feel free to downvote because a non-working answer is probably not helpful.
1 - Editing code in questions is always discouraged, except to fix spacing in non-whitespace sensitive languages.
But if you want to continue fixing code in answers because you think it is better, then read on...
For this specific edit, you could have done yourself a favor - you could have made the edit description more clear:
Added easy.install as dep, this worked for me
Ok, so what, it worked for you, but that doesn't say why you did it.
You should have expanded it slightly to say something like:
Per the comments, this solution is not working for many users. Edited so that it is correct.
When a reviewer sees this, they will understand why you did it and why you thought it was necessary to make the edit.
It still may result in the edit getting rejected because of the disputed practice of editing code in answers, but it stands a much better chance of getting accepted.
DISCLAIMER: I have no idea if your edit is correct or not, I'm not familiar, so I am assuming your edit is correct