'How do I restore python libraries

I recently downloaded node.js and it installed python version 3.10(I was using 3.9). However, it seems like it deleted python3.9 and it's libraries is there any other way to restore the libraries? this is the output of pip list (I installed cryptocompare manually)

C:\Users\MyName>pip list
WARNING: Ignoring invalid distribution -p (c:\python310\lib\site-packages)
WARNING: Ignoring invalid distribution -p (c:\python310\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (c:\python310\lib\site-packages)
WARNING: Ignoring invalid distribution - (c:\python310\lib\site-packages)
Package            Version
------------------ -----------
certifi            2022.5.18.1
charset-normalizer 2.0.12
cryptocompare      0.7.5
idna               3.3
pip                22.1
pywin32            304
requests           2.27.1
setuptools         58.1.0
urllib3            1.26.9
varint             1.0.2
WARNING: Ignoring invalid distribution -p (c:\python310\lib\site-packages)
WARNING: Ignoring invalid distribution -p (c:\python310\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (c:\python310\lib\site-packages)
WARNING: Ignoring invalid distribution - (c:\python310\lib\site-packages)
WARNING: Ignoring invalid distribution -p (c:\python310\lib\site-packages)
WARNING: Ignoring invalid distribution -p (c:\python310\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (c:\python310\lib\site-packages)
WARNING: Ignoring invalid distribution - (c:\python310\lib\site-packages)
WARNING: Ignoring invalid distribution -p (c:\python310\lib\site-packages)
WARNING: Ignoring invalid distribution -p (c:\python310\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (c:\python310\lib\site-packages)
WARNING: Ignoring invalid distribution - (c:\python310\lib\site-packages)


Solution 1:[1]

When pip uninstalls a package, it first renames it to prefix of ~, and when it's sure that everything is alright, it will remove the uninstalled package. In your case, it looks like you had problems installing pip, the Python packager itself. While I haven't faced this problem myself, most tutorials in the Web suggest that you should remove the offending folders from the distribution folder, that in your case is c:\python310\lib\site-packages. That will solve the warning.

If you face further problems with pip, if you should download get-pip.py and run, that will install a correct pip and wheel to a problematic installation.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1