GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — ModuleNotFoundError: No module named 'gitdb.utils.compat' · Issue #983 · gitpython-developers/GitPython

ModuleNotFoundError: No module named 'gitdb.utils.compat' #983

New issue
Copy link
New issue
Copy link
Closed
Closed
ModuleNotFoundError: No module named 'gitdb.utils.compat'#983
Copy link
Labels
acknowledged

Description

@mell0
mell0
opened on Feb 17, 2020
Issue body actions

Requirments file includes gitdb2 and, but "compat.py" file is importing "gitdb" instead and throwing missing "gitdb" module error when this library is fresh installed in a new enviroment with missing "gitdb" dependency library. Please fix the problem.

Reacted by 0x26res, Rendy Pranata, Jinbo Wang, Ben Rifkind, Prakash Chandra, xufwind95, Andrew Lott, Daniel Vu Dao, Saisankar Gochhayat, FNEOSLDI and 10 more
Reacted by Shaikh Riyaz, Vladimir Chub and Deepak Sharma

Activity

Next
  1. davidwneary commented on Feb 17, 2020

    @davidwneary
    davidwneary
    on Feb 17, 2020
    More actions

    Experiencing the same here.

    from gitdb.utils.compat import (
     ModuleNotFoundError: No module named 'gitdb.utils.compat'
    

    We're using the 3.0.5 release. Looks like the latest release to gitdb (3.0.2) has caused the issue - if I add gitdb2==3.0.1 to my requirements.txt, it's fixed.

    Reacted by MaShuo, Krzysztof, Saisankar Gochhayat, Deepak Sharma, Shyamin Ayesh, Azzam S.A, Mohit Maithani, Hamman Samuel, Matthias Greiner and Thomaz
    Reacted by Mohit Maithani
  2. Harmon758 commented on Feb 17, 2020

    @Harmon758
    Harmon758
    on Feb 17, 2020
    Member
    More actions

    @davidwneary Ah, that issue is due to GitDB v3.0.2 removing gitdb.utils.compat.
    I'll push a fix momentarily.
    That import was removed with GitPython v3.0.6 (b5dd2f0, a10ceef, 5d22d57) so the latest versions shouldn't have that issue.

    @mell0 gitdb2 is the same gitdb library renamed on PyPI due to loss of access to the original PyPI account. See gitpython-developers/gitdb#45, gitpython-developers/gitdb#47, and pypi/support#204. The import remains gitdb.

    Reacted by ChristianKuehnel, Adrià Garriga-Alonso and Derek Ardolf
  3. Harmon758
    added
    acknowledged
    on Feb 17, 2020
  4. Harmon758 commented on Feb 17, 2020

    @Harmon758
    Harmon758
    on Feb 17, 2020
    Member
    More actions

    @davidwneary Actually, that import was removed with v3.0.6. This should be resolved in the latest versions.

  5. Harmon758 commented on Feb 17, 2020

    @Harmon758
    Harmon758
    on Feb 17, 2020
    Member
    More actions

    @mell0 I'm unable to reproduce this in a new environment with the latest versions of both libraries, i.e. gitpython v3.0.8 and gitdb2 v3.0.2. If your issue is different, can you provide the details of your environment, e.g. gitpython, gitdb2, and python versions, and the full traceback?

  6. Harmon758
    added
    cannot reproduce
    waiting for feedback
    on Feb 17, 2020
  7. mell0 commented on Feb 17, 2020

    @mell0
    mell0
    on Feb 17, 2020
    Author
    More actions

    Hi,

    Problem is when trying to install an older version for GitPython which I had in my test requirements file, to be specific v3.0.4. I understood that this was fixed in versions above v3.0.6. It's just that v3.0.4 should have used in its requirements working gitdb2 version with compat included, because now I have a lot of deployment fails of my apps and I'm sure it's not only me. In my opinion requirements should contain more specific version of the dependencies not just >=, because thus way people using older version and relying on it are suffering and in general at the moment older versions <=v3.0.6 are not working.

  8. mell0 commented on Feb 17, 2020

    @mell0
    mell0
    on Feb 17, 2020
    Author
    More actions

    To reproduce, just create new virtual env, try to install GitPython==3.0.4, and try to import it.

  9. Harmon758 commented on Feb 17, 2020

    @Harmon758
    Harmon758
    on Feb 17, 2020
    Member
    More actions

    I agree that the versioning is less than ideal here. In fact, GitPython shouldn't have been using GitDB compatibility shims in the first place, causing the removal to be a breaking change, as they should have been internal rather than exposed.

    I've gone ahead and restricted the gitdb2 version to < 4 now with e81fd54 to mitigate future issues like this, and it should be part of the next release.

    However, there's not much that can be done at this point for older versions that rely on gitdb2 < 3.0.2. Even if the GitDB removal was reverted, since it wasn't restricted to < or <= any certain version for GitPython, any breaking change in the future would still break older GitPython versions.
    But since the only GitPython version requirement for gitdb2 was >= 2 for older versions, you can simply specify gitdb2 < 3.0.2 in your own dependencies if you want to continue using an older version of GitPython.

    In fact, there was an issue with the formatting of the version specifier that wasn't fixed until GitPython v3.0.6, so you should be able to specify and install any gitdb2 version (although I can't guarantee that it'll work with < 2). It's just that, by default, the latest version will be installed.

    Reacted by 0x26res and Laura Beaufort
    Reacted by Francis Charette-Migneault, Chris Guillory and Dion Bosschieter
  10. Harmon758
    closed this as completedon Feb 17, 2020
  11. Harmon758
    removed
    cannot reproduce
    waiting for feedback
    on Feb 17, 2020
  12. jimoleary
    added a commit that references this issue on Feb 17, 2020

    work around GitPython issue (gitpython-developers/GitPython#983)

    ccd65fa
  13. fmigneault commented on Feb 18, 2020

    @fmigneault
    fmigneault
    on Feb 18, 2020
    More actions

    @Harmon758
    You could do a post release (https://www.python.org/dev/peps/pep-0440/#post-releases).
    An hotfix for such a thing would avoid many unexpected problems by devs that tagged this version in order to have stable code, but suddenly still get an error.

    I would also argue that using the patch number instead of (at least) minor for such big refactoring isn't really a best practice to avoid situations like this in the future.

  14. 28 remaining items

  15. thbeutin
    added a commit that references this issue on Mar 19, 2020

    increased requested gitpython version to v3.0.8 to avoid this:

    eef21a5
  16. klml
    added a commit that references this issue on Apr 8, 2020

    GitPython==3.1.0 gitpython-developers/GitPython#983

    0d5d544
  17. Byron
    unpinned this issue on Apr 11, 2020
  18. danielvdende
    added a commit that references this issue on May 4, 2020

    Update tests and fix gitpython version

    c8123ca
  19. hannes-ucsc
    added a commit that references this issue on Sep 10, 2020

    Pin transitive dep on gitdb to avoid ModuleNotFoundError

    ca5be4d
  20. alangoldman
    added a commit that references this issue on Sep 23, 2020

    The old version of gitpython is broken now.

    c915b05
  21. paterit
    added a commit that references this issue on Oct 18, 2020

    Update GitPython version due to gitpython-developers/GitPython#983

    9d44528
  22. mmaithani commented on Dec 4, 2020

    @mmaithani
    mmaithani
    on Dec 4, 2020
    More actions

    Experiencing the same here.

    from gitdb.utils.compat import (
     ModuleNotFoundError: No module named 'gitdb.utils.compat'
    

    We're using the 3.0.5 release. Looks like the latest release to gitdb (3.0.2) has caused the issue - if I add gitdb2==3.0.1 to my requirements.txt, it's fixed.

    yeah 3.0.1 worked for me too, Thanks !

  23. sergeyklay
    added a commit that references this issue on Dec 24, 2020

    Bump GitPython version to fix a crash for gitdb.utils.compat

    67e936a
  24. jose
    added a commit that references this issue on Feb 17, 2021

    Attempt to fix gitpython-developers/GitPython#983.

    2edd2e2
  25. lvarin
    added a commit that references this issue on Mar 1, 2021

    Test new version of GitPython gitpython-developers/GitPython#983

    023f4c8
  26. kevinlul
    added a commit that references this issue on Dec 15, 2021

    Remove dependency on outdated GitPython

    49e57f7
  27. danielmcmir
    added a commit that references this issue on Jun 9, 2022

    Update GitPython dependency

    628eb6d
  28. frewmack
    added a commit that references this issue on Aug 3, 2022

    Squashed commit of the following:

    62f69af
  29. hannes-ucsc
    added a commit that references this issue on Nov 17, 2022

    Pin transitive dep on gitdb to avoid ModuleNotFoundError

    d5258e7
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

    acknowledged

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.