This will install the package.

pip3 install PyGithub

If you're getting the same error that could be due to circular imports. Rename if you have any .py files named "github.py" in your work folder.

Answer from nrnw on Stack Overflow
Discussions

ModuleNotFoundError: No module named 'github'
Hello. I have installed Miniconda3, and added it to my path. Installed conda-build, and followed the pip install from github command in the README. When typing bioconda-utils.py -h, I get: File "/h... More on github.com
🌐 github.com
5
September 5, 2017
python - ModuleNotFoundError: No module named github, on raspberry pi - Stack Overflow
I was curious if anyone knew a workaround, or what I am doing wrong when trying to install the import GitHub on Raspberry Pi. On my main machine all I needed to do was import github, and then it wo... More on stackoverflow.com
🌐 stackoverflow.com
python - fixing an 'from github import Github' error - CS50 Stack Exchange
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. ERROR MESSAGE: ModuleNotFoundError: No module named ‘g... More on cs50.stackexchange.com
🌐 cs50.stackexchange.com
March 29, 2023
ModuleNotFoundError: No module named. In github actions by using pytest
ModuleNotFoundError: No module named. More on github.com
🌐 github.com
7
November 23, 2024
🌐
GitHub
github.com › PyGithub › PyGithub › issues › 856
ImportError: No module named github · Issue #856 · PyGithub/PyGithub
August 7, 2018 - I'm trying to use PyGitHub and I'm getting "ImportError: No module named github". Setup specs: macOS v10.13.6 Python v3.7.0 Installed with pip v18.0
Author   JosephTLyons
🌐
GitHub
github.com › bioconda › bioconda-utils › issues › 106
ModuleNotFoundError: No module named 'github' · Issue #106 · bioconda/bioconda-utils
September 5, 2017 - File "/home/agoncalves/miniconda3/lib/python3.6/site-packages/bioconda_utils/github_integration.py", line 1, in <module> import github ModuleNotFoundError: No module named 'github'
Author   andersgs
🌐
Stack Overflow
stackoverflow.com › questions › 68463959 › modulenotfounderror-no-module-named-github-on-raspberry-pi
python - ModuleNotFoundError: No module named github, on raspberry pi - Stack Overflow
I have made sure that I am using python 3 and have also made sure that I have root access, but still no luck. Any help would be greatly appreciated. ... github is an old package with only version 0.0.0 on PyPI. You are surely looking for one of the countless other github packages. ... It appears the module that provides an import named github is in fact PyGithub.
🌐
Stack Exchange
cs50.stackexchange.com › questions › 43910 › fixing-an-from-github-import-github-error
python - fixing an 'from github import Github' error - CS50 Stack Exchange
March 29, 2023 - 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') else: for action in actions.permissions: print(f'{action} has permissions set on the repo')
🌐
GitHub
github.com › pytest-dev › pytest › issues › 12984
ModuleNotFoundError: No module named. In github actions by using pytest · Issue #12984 · pytest-dev/pytest
November 23, 2024 - Hint: make sure your test modules/packages have valid Python names. Traceback: /opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/importlib/__init__.py:126: in import_module return _bootstrap._gcd_import(name[level:], package, level) E ModuleNotFoundError: No module named 'tests.model.test_streamlit'
Author   danilyef
🌐
GitHub
github.com › mazen160 › GithubCloner › issues › 3
ModuleNotFoundError: No module named 'git' · Issue #3 · mazen160/GithubCloner
April 11, 2018 - Hi, sorry for being new to this. Trying to run your script, get this error: Traceback (most recent call last): File "./githubcloner.py", line 18, in import git ModuleNotFoundError: No module named 'git'
Author   rsmolkin
Find elsewhere
🌐
Reddit
reddit.com › r/learnpython › problems with modules
r/learnpython on Reddit: Problems with modules
February 6, 2020 -

Hello :) ,

I'm a newbie, started messing around with python a few days ago.

I find myself sitting hours about this shit actually.

No matter what I do, almost always when I run the python script I get an ModuleNotFoundError, and it doesn't even matter what package it is.

For example I'm trying to import the PyGithub module for a small project:

when using the command python [name_of_the_script], it returns: ImportError: No module named github

when using the command python3 [name_of_the_script], it returns:

Traceback (most recent call last):
  File "app.py", line 3, in <module>
    import github
  File "/home/mectos/.local/lib/python3.8/site-packages/github/__init__.py", line 58, in <module>
    from github.MainClass import Github, GithubIntegration
  File "/home/mectos/.local/lib/python3.8/site-packages/github/MainClass.py", line 56, in <module>
    import requests
  File "/home/mectos/.local/lib/python3.8/site-packages/requests/__init__.py", line 112, in <module>
    from . import utils
  File "/home/mectos/.local/lib/python3.8/site-packages/requests/utils.py", line 25, in <module>
    from . import certs
  File "/home/mectos/.local/lib/python3.8/site-packages/requests/certs.py", line 15, in <module>
    from certifi import where
ModuleNotFoundError: No module named 'certifi'

when using the command python3.8 [name_of_the_script], it returns:

Traceback (most recent call last):
  File "app.py", line 3, in <module>
    import github
  File "/home/mectos/.local/lib/python3.8/site-packages/github/__init__.py", line 58, in <module>
    from github.MainClass import Github, GithubIntegration
  File "/home/mectos/.local/lib/python3.8/site-packages/github/MainClass.py", line 56, in <module>
    import requests
  File "/home/mectos/.local/lib/python3.8/site-packages/requests/__init__.py", line 112, in <module>
    from . import utils
  File "/home/mectos/.local/lib/python3.8/site-packages/requests/utils.py", line 25, in <module>
    from . import certs
  File "/home/mectos/.local/lib/python3.8/site-packages/requests/certs.py", line 15, in <module>
    from certifi import where
ModuleNotFoundError: No module named 'certifi'
  • important note:

    The thing is, it changes the "required" package every time. The scenario is as follows:

    I get this error about the certain module

    • I run pip3 install [package]

    • it tells me that it already exists in /usr/bin/python3.8/dist_packages -> I navigate to this directory

    • manually run sudo rm -rf [package]

    • then run again pip3 install [package]

    • it downloads it successfully

    • I try again [python/python3/python3.8] [name_of_the_script]

    • And then it returns that some another random package is missing.

  • I presume I have some kind of problem with my packages or PYTHONPATH or whatever?

  • I'm actually baffled, started with python after a few months with HTML, CSS, JS and JS's package manager npm. So things are slightly different here in Python compared to JS.

Much appreciations in advance for all the help!

🌐
PythonAnywhere
pythonanywhere.com › forums › topic › 26784
Can't import module : Forums : PythonAnywhere
February 10, 2020 - 2020-02-10 09:55:05,974: ModuleNotFoundError: No module named 'github'
🌐
GitHub
github.com › AnswerDotAI › nbdev › issues › 936
Deploy Action fails with `ModuleNotFoundError: No module named 'https://github'` · Issue #936 · AnswerDotAI/nbdev
August 25, 2022 - Specifically I get an error saying ModuleNotFoundError: No module named 'https://github' from nbdev/doclinks.py The error is the following.
Author   Attol8
🌐
Finxter
blog.finxter.com › fixed-modulenotfounderror-no-module-named-git-python
(Fixed) ModuleNotFoundError: No Module Named ‘git’ | Python – Be on the Right Side of Change
November 21, 2022 - Quick Fix: Python raises the ModuleNotFoundError: No module named 'git' when you haven’t installed GitPython explicitly with pip install GitPython or pip3 install GitPython (Python 3).
🌐
GitHub
github.com › orgs › community › discussions › 151556
Persistent ModuleNotFoundError: No module named 'backend' in GitHub Codespaces - Python FastAPI Project · community · Discussion #151556
February 15, 2025 - Hello GitHub Community, I am encountering a persistent and baffling "ModuleNotFoundError: No module named 'backend'" error when trying to run my Python FastAPI application locally within GitHub Cod...
🌐
Microsoft Learn
learn.microsoft.com › en-us › answers › questions › 2147153 › modules-not-found-after-continuous-deployment-from
Modules Not Found After Continuous Deployment from GitHub to Azure Function App - Microsoft Q&A
January 14, 2025 - I faced the same issue: deployment from VS Code worked smoothly, but when deploying from GitHub using the default .yml workflow generated by the Azure Portal, none of the libraries from requirements.txt were installed. This resulted in ModuleNotFoundError, or an empty list of functions on Azure Portal. Forcing remote build with Oryx resolved the issue. While documentation suggests setting environmental variables, these settings are ignored or overwritten as false by @Azure/functions-action@v1 unless explicitly stated in the .yml file. # ... - name: 'Deploy to Azure Functions' uses: Azure/functions-action@v1 id: deploy-to-function with: app-name: '...' slot-name: 'Production' package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }} publish-profile: ${{ ...
🌐
Bobby Hadz
bobbyhadz.com › blog › python-no-module-named-git
ModuleNotFoundError: No module named 'git' in Python | bobbyhadz
April 8, 2024 - The Python "ModuleNotFoundError: No module named 'git'" occurs when we forget to install the GitPython module before importing it or install it in an incorrect environment.
🌐
GitHub
github.com › AUTOMATIC1111 › stable-diffusion-webui › discussions › 10912
Urgent help required No module named 'modules' error despite the modules file installed · AUTOMATIC1111/stable-diffusion-webui · Discussion #10912
June 1, 2023 - Rename the library file For example : venu/lib/site-package Find the error library file name in my case jsonmerge file But in my system have jsonmerge -1.8.0.dist so I rename it jsonmerge and run test int
Author   AUTOMATIC1111
🌐
Python.org
discuss.python.org › python help
Python doesn’t find module although it is installed in github workflow - Python Help - Discussions on Python.org
May 9, 2024 - I have created a package containing some python files using setup.py. Built the package using pip install . I installed the package in my project as it is not published using command ‘pip install git+https://github.com/…