I continue to receive this error message for when I attempt to import GitHub to my visual studio code in order to have it read the repository.


ModuleNotFoundError: No module named ‘github’.

I need to be able to test my code fully to see if it can run, but I cannot get past this error code. Would someone please be able to give me a solution or some type of help to get past this?

Yes I have PyGithub already installed as well. So I am not sure why it is not reading in the system. I will provide my code below so you can see what I am doing:

from github import Github

#Authenticate with GitHub

g = Github('<PAT>') #Replace <PAT> with your personal access token

#Get the repository
repo = g.get_repo('repo') #Replace 'repo' with the name of your repository

#Determine which actions have permissions set on the repo
actions = repo.get_actions()
if not actions.permissions:
print('No actions have permissions set on the repo')
for action in actions.permissions:
print(f'{action} has permissions set on the repo')

Is there anyone that could help resolve this, so I can run my code fully?


You must log in to answer this question.

Browse other questions tagged .