Uninstall your current python and its launcher from control penal
Then download new python version and install it
While installing new one make sure you tick Add Launcher to all users(recommended) and ADD python to PATH both.
Now click customized install and tick all the boxes and install it
After install complete open powershell or cmd and type python to check it is
installed properly if you see:
PS C:\Users\Rohit> python
Python 3.10.0 (tags/v3.10.0:b494f59, Oct 4 2021, 19:00:18) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
exit()
type exit() for quit python
This that means successfully installed
4.Now let's type pip + ENTER
if you see multiple pip commands congratulations your good to go
5.Okay then try to install your required python library
e.g : pip install pyttsx
PS C:\Users\Rohit> pip install pyttsx3
Defaulting to user installation because normal site-packages is not writeable
Collecting pyttsx3
Using cached pyttsx3-2.90-py3-none-any.whl (39 kB)
Collecting pywin32
Using cached pywin32-302-cp310-cp310-win_amd64.whl (9.2 MB)
Collecting pypiwin32
Using cached pypiwin32-223-py3-none-any.whl (1.7 kB)
Collecting comtypes
Using cached comtypes-1.1.10.tar.gz (145 kB)
Using legacy 'setup.py install' for comtypes, since package 'wheel' is not installed.
Installing collected packages: pywin32, pypiwin32, comtypes, pyttsx3
If your see this kind of stuff, your problem is solved.
NOTE : In case it not solved go to Microsoft store and install python and launch it. Then press windows button and search for edit environment variable >> environment variable. Check if python is added to the PATH if not then add it.