Hi @ahmed salah ,
Welcome to Microsoft Q&A!
You cannot use get_installed_distributions() directly after pip upgrade to 10.0. You can try the method in the link mentioned by NaomiNNN.
You can use from pip._internal.utils.misc import get_installed_distributions
. This should work, but this method is strongly not recommended.
AttributeError: module 'pip' has no attribute 'get_installed_distributions'
Here is a document that explains the reason for this error. See this pip document.
Here is a similar thread please have a look: https://github.com/pypa/pip/issues/5243
After reading it, you will find setuptools (specifically pkg_resources) may be a good choice for you.
Best regards,
Seeya
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.