GeezerVison is showing github.com — ModuleNotFoundError: No module named 'gitdb.utils.compat' · Issue #983 · gitpython-developers/GitPython
ModuleNotFoundError: No module named 'gitdb.utils.compat' #983DescriptionRequirments 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 Activitydavidwneary commented on Feb 17, 2020 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 Harmon758 commented on Feb 17, 2020 Reacted by ChristianKuehnel, Adrià Garriga-Alonso and Derek Ardolf Harmon758 commented on Feb 17, 2020 @davidwneary Actually, that import was removed with v3.0.6. This should be resolved in the latest versions. Harmon758 commented on Feb 17, 2020 @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? mell0 commented on Feb 17, 2020 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. mell0 commented on Feb 17, 2020 To reproduce, just create new virtual env, try to install GitPython==3.0.4, and try to import it. Harmon758 commented on Feb 17, 2020 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 fmigneault commented on Feb 18, 2020 @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. mmaithani commented on Dec 4, 2020
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 !
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|