'HTTP basic authorisation ERROR 401. showing , but I am entering right email and password

import requests

from requests.auth import HTTPBasicAuth

a=requests.get('https://api.github.com/user',auth=HTTPBasicAuth('email','pass'))
print(a.status_code)

I am entering right GitHub email and password but getting error 401



Solution 1:[1]

Username: password is not longer supported by GitHub for API https://docs.github.com/en/rest/overview/other-authentication-methods#via-oauth-and-personal-access-tokens

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 gnight