Skip to content
This repository was archived by the owner on Oct 24, 2022. It is now read-only.
This repository was archived by the owner on Oct 24, 2022. It is now read-only.

Unable to install via pip (python 3.4) #41

Open

Description

@LizzyTrickster

When trying to pip3 install pygithub3 I get the following

bot@theender:~/EnderBot3/bin$ ./pip3 install pygithub3
Downloading/unpacking pygithub3
  Downloading pygithub3-0.5.1.tar.gz
  Running setup.py (path:/home/znc/EnderBot3/build/pygithub3/setup.py) egg_info for package pygithub3
    Traceback (most recent call last):
      File "<string>", line 17, in <module>
      File "/home/znc/EnderBot3/build/pygithub3/setup.py", line 7, in <module>
        import pygithub3
      File "/home/znc/EnderBot3/build/pygithub3/pygithub3/__init__.py", line 10, in <module>
        from github import Github
    ImportError: No module named 'github'
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 17, in <module>

  File "/home/znc/EnderBot3/build/pygithub3/setup.py", line 7, in <module>

    import pygithub3

  File "/home/znc/EnderBot3/build/pygithub3/pygithub3/__init__.py", line 10, in <module>

    from github import Github

ImportError: No module named 'github'

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /home/znc/EnderBot3/build/pygithub3
Storing debug log for failure in /home/znc/.pip/pip.log

Is there perhaps another step for installing that the readme doesn't tell about?

Activity

  1. jpverkamp commented on Sep 8, 2015

    @jpverkamp

    I got it working by running pip3 install pygithub first. I'm not sure if it depends directly on that library or if that one correctly specifies dependencies, but it does work.

  2. kirsle commented on Mar 10, 2016

    @kirsle

    I found what's probably the root cause of the above errors and the reason why installing pygithub first seems to resolve it:

    pygithub3 uses a relative import: from github import Github -- it wants its own local github.py, but relative imports are only supported in Python 2; in Python 3 all imports must be absolute, or else this module would've had to do from .github import Github to explicitly import the local module. By installing pygithub first, you actually mask the underlying problem. When the __init__.py wants to import the local ./github.py module, it instead actually imports the other module you installed (pygithub).

    The API is different between the two modules. You might end up with an error like this:

    Traceback (most recent call last):
      File "./gitchangelog.py", line 309, in <module>
        github.main(args)
      File "./gitchangelog.py", line 38, in main
        reset=args.init)
      File "./gitchangelog.py", line 111, in authenticate
        self.api = Github(user=user, token=token, repo=repo)
    TypeError: __init__() got an unexpected keyword argument 'repo'
    
  3. jpverkamp commented on Mar 10, 2016

    @jpverkamp

    Hmm, the install looks to be a suboptimal way to solve it then (although in limited cases such as what I was doing, it does work well enough).

  4. chemelli74 commented on Apr 26, 2022

    @chemelli74

    Issue still valid.
    Solved the same way: pip install pygithub as prerequisite

    Simone

  5. kirsle commented on May 9, 2022

    @kirsle

    Note that if you're solving this issue by doing pip install pygithub, you may actually end up with a Frankenstein's monster of a Python module.

    Just use pygithub rather than python-github3 until the issue is properly fixed in this module. Per my earlier comment, installing pygithub "fixes" the issue because python-github3 actually ends up importing pygithub's github.py module rather than its own github.py module... which causes the error to go away, but now you have this module using the other module in weird ways that will likely lead to further confusion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions