I want to try PyGitHub a Python library to access the GitHub REST API.
python imterpreter: anaconda python 3.10
the first step, I install the command
pip install PyGithub
after that, I try to follow the tutorial to create a GitHub instance:
from github import Github
from github import Auth
auth = Auth.Token("access_token")
g = Github(auth=auth)
g = Github(auth=auth, base_url="https://{hostname}/api/v3")
This error message how to solve
from github import Auth
ImportError: cannot import name 'Auth' from 'github'

Having the same problem with importing
Auth.The old approach still works, even though I have no idea which approach is better.
I put the access token as a string in the code for simplicity. In my actual code, I am using a config file to import the token.