René's URL Explorer Experiment


Title: [GitPython >= 2.1.4] Can't import without git CLI · Issue #657 · gitpython-developers/GitPython · GitHub

Open Graph Title: [GitPython >= 2.1.4] Can't import without git CLI · Issue #657 · gitpython-developers/GitPython

X Title: [GitPython >= 2.1.4] Can't import without git CLI · Issue #657 · gitpython-developers/GitPython

Description: Description of Problem Since GitPython 2.1.4, the initial import git fails because it invokes the git CLI, raising a git.exc.GitCommandNotFound error. However, due to the chicken-and-egg nature of this import, it is impossible for one to...

Open Graph Description: Description of Problem Since GitPython 2.1.4, the initial import git fails because it invokes the git CLI, raising a git.exc.GitCommandNotFound error. However, due to the chicken-and-egg nature of ...

X Description: Description of Problem Since GitPython 2.1.4, the initial import git fails because it invokes the git CLI, raising a git.exc.GitCommandNotFound error. However, due to the chicken-and-egg nature of ...

Opengraph URL: https://github.com/gitpython-developers/GitPython/issues/657

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[GitPython \u003e= 2.1.4] Can't import without git CLI","articleBody":"## Description of Problem\r\n\r\nSince GitPython 2.1.4, the initial `import git` fails because it invokes the git CLI, raising a `git.exc.GitCommandNotFound` error. However, due to the chicken-and-egg nature of this import, it is impossible for one to catch a `git.exc.GitCommandNotFound` error.\r\n\r\n## Steps to Reproduce\r\n\r\nInstall GitPython \u003e= 2.1.4 on a box without git installed on it. An easy way to do this is to launch a Cent 7 docker container (which does not come with git installed off the base image), and then install GitPython (first installing EPEL repo and pip for ease of installation).\r\n\r\n```\r\n% docker run --rm -it centos:7 bash\r\n[root@c1c079f693dc /]# yum --quiet -y install epel-release\r\nwarning: /var/cache/yum/x86_64/7/extras/packages/epel-release-7-9.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY\r\nPublic key for epel-release-7-9.noarch.rpm is not installed\r\nImporting GPG key 0xF4A80EB5:\r\n Userid     : \"CentOS-7 Key (CentOS 7 Official Signing Key) \u003csecurity@centos.org\u003e\"\r\n Fingerprint: 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5\r\n Package    : centos-release-7-3.1611.el7.centos.x86_64 (@CentOS)\r\n From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7\r\n[root@c1c079f693dc /]# yum --quiet -y install python-pip\r\nwarning: /var/cache/yum/x86_64/7/epel/packages/python2-pip-8.1.2-5.el7.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID 352c64e5: NOKEY\r\nPublic key for python2-pip-8.1.2-5.el7.noarch.rpm is not installed\r\nImporting GPG key 0x352C64E5:\r\n Userid     : \"Fedora EPEL (7) \u003cepel@fedoraproject.org\u003e\"\r\n Fingerprint: 91e9 7d7c 4a5e 96f1 7f3e 888f 6a2f aea2 352c 64e5\r\n Package    : epel-release-7-9.noarch (@extras)\r\n From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7\r\n[root@c1c079f693dc /]# command -v git \u0026\u0026 echo git is installed || echo git is not installed\r\ngit is not installed\r\nroot@c1c079f693dc /]# pip install GitPython\r\nCollecting GitPython\r\n  Downloading GitPython-2.1.5-py2.py3-none-any.whl (443kB)\r\n    100% |################################| 450kB 1.0MB/s\r\nCollecting gitdb2\u003e=2.0.0 (from GitPython)\r\n  Downloading gitdb2-2.0.2-py2.py3-none-any.whl (63kB)\r\n    100% |################################| 71kB 2.1MB/s\r\nCollecting smmap2\u003e=2.0.0 (from gitdb2\u003e=2.0.0-\u003eGitPython)\r\n  Downloading smmap2-2.0.3-py2.py3-none-any.whl\r\nInstalling collected packages: smmap2, gitdb2, GitPython\r\nSuccessfully installed GitPython-2.1.5 gitdb2-2.0.2 smmap2-2.0.3\r\nYou are using pip version 8.1.2, however version 9.0.1 is available.\r\nYou should consider upgrading via the 'pip install --upgrade pip' command.\r\n```\r\n\r\nNow attempt to import:\r\n\r\n```\r\n[root@c1c079f693dc /]# python -c 'import git'\r\nTraceback (most recent call last):\r\n  File \"\u003cstring\u003e\", line 1, in \u003cmodule\u003e\r\n  File \"/usr/lib/python2.7/site-packages/git/__init__.py\", line 45, in \u003cmodule\u003e\r\n    from git.repo import Repo               # @NoMove @IgnorePep8\r\n  File \"/usr/lib/python2.7/site-packages/git/repo/__init__.py\", line 4, in \u003cmodule\u003e\r\n    from .base import *\r\n  File \"/usr/lib/python2.7/site-packages/git/repo/base.py\", line 31, in \u003cmodule\u003e\r\n    from git.remote import Remote, add_progress, to_progress_instance\r\n  File \"/usr/lib/python2.7/site-packages/git/remote.py\", line 190, in \u003cmodule\u003e\r\n    class FetchInfo(object):\r\n  File \"/usr/lib/python2.7/site-packages/git/remote.py\", line 219, in FetchInfo\r\n    v = Git().version_info[:2]\r\n  File \"/usr/lib/python2.7/site-packages/git/cmd.py\", line 461, in version_info\r\n    return self._version_info\r\n  File \"/usr/lib/python2.7/site-packages/git/cmd.py\", line 424, in __getattr__\r\n    return LazyMixin.__getattr__(self, name)\r\n  File \"/usr/lib/python2.7/site-packages/gitdb/util.py\", line 256, in __getattr__\r\n    self._set_cache_(attr)\r\n  File \"/usr/lib/python2.7/site-packages/git/cmd.py\", line 444, in _set_cache_\r\n    version_numbers = self._call_process('version').split(' ')[2]\r\n  File \"/usr/lib/python2.7/site-packages/git/cmd.py\", line 877, in _call_process\r\n    return self.execute(call, **exec_kwargs)\r\n  File \"/usr/lib/python2.7/site-packages/git/cmd.py\", line 602, in execute\r\n    raise GitCommandNotFound(command, err)\r\ngit.exc.GitCommandNotFound: Cmd('git') not found due to: OSError('[Errno 2] No such file or directory')\r\n  cmdline: git version\r\n```\r\n\r\nIf you then downgrade to before version 2.1.4, the import works fine since the initial import no longer seems to be trying to invoke the git CLI:\r\n\r\n```\r\n[root@c1c079f693dc /]# pip install 'GitPython\u003c2.1.4'\r\nCollecting GitPython\u003c2.1.4\r\n  Downloading GitPython-2.1.3-py2.py3-none-any.whl (442kB)\r\n    100% |################################| 450kB 993kB/s\r\nRequirement already satisfied (use --upgrade to upgrade): gitdb2\u003e=2.0.0 in /usr/lib/python2.7/site-packages (from GitPython\u003c2.1.4)\r\nRequirement already satisfied (use --upgrade to upgrade): smmap2\u003e=2.0.0 in /usr/lib/python2.7/site-packages (from gitdb2\u003e=2.0.0-\u003eGitPython\u003c2.1.4)\r\nInstalling collected packages: GitPython\r\n  Found existing installation: GitPython 2.1.5\r\n    Uninstalling GitPython-2.1.5:\r\n      Successfully uninstalled GitPython-2.1.5\r\nSuccessfully installed GitPython-2.1.3\r\nYou are using pip version 8.1.2, however version 9.0.1 is available.\r\nYou should consider upgrading via the 'pip install --upgrade pip' command.\r\n[root@c1c079f693dc /]# python -c 'import git'\r\n[root@c1c079f693dc /]#\r\n```","author":{"url":"https://github.com/terminalmage","@type":"Person","name":"terminalmage"},"datePublished":"2017-08-10T21:08:55.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/657/GitPython/issues/657"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:ff807020-fe9f-d386-568a-aaf79d4c0799
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id9EA4:2C9A2F:527E7C:6DF64C:6969C893
html-safe-nonce17b1d4179a9e8c4d47d12991fb106857ed6e4dfe0539026f218e0f9fb7d1c546
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RUE0OjJDOUEyRjo1MjdFN0M6NkRGNjRDOjY5NjlDODkzIiwidmlzaXRvcl9pZCI6Ijg1MzYwNjYyOTM2MDMzNTQ3NzEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac22251cf211fc0928656e984013273877e78e35bd3f2430f4c1760f59453b10c0
hovercard-subject-tagissue:249477375
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/gitpython-developers/GitPython/657/issue_layout
twitter:imagehttps://opengraph.githubassets.com/9d55fa55dc79af2fa68afdbfbddd59e3731a19e74dcce551805980174f419778/gitpython-developers/GitPython/issues/657
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/9d55fa55dc79af2fa68afdbfbddd59e3731a19e74dcce551805980174f419778/gitpython-developers/GitPython/issues/657
og:image:altDescription of Problem Since GitPython 2.1.4, the initial import git fails because it invokes the git CLI, raising a git.exc.GitCommandNotFound error. However, due to the chicken-and-egg nature of ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameterminalmage
hostnamegithub.com
expected-hostnamegithub.com
Noneacedec8b5f975d9e3d494ddd8f949b0b8a0de59d393901e26f73df9dcba80056
turbo-cache-controlno-preview
go-importgithub.com/gitpython-developers/GitPython git https://github.com/gitpython-developers/GitPython.git
octolytics-dimension-user_id503709
octolytics-dimension-user_logingitpython-developers
octolytics-dimension-repository_id1126087
octolytics-dimension-repository_nwogitpython-developers/GitPython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1126087
octolytics-dimension-repository_network_root_nwogitpython-developers/GitPython
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release83c08c21cdda978090dc44364b71aa5bc6dcea79
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/gitpython-developers/GitPython/issues/657#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgitpython-developers%2FGitPython%2Fissues%2F657
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgitpython-developers%2FGitPython%2Fissues%2F657
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=gitpython-developers%2FGitPython
Reloadhttps://github.com/gitpython-developers/GitPython/issues/657
Reloadhttps://github.com/gitpython-developers/GitPython/issues/657
Reloadhttps://github.com/gitpython-developers/GitPython/issues/657
gitpython-developers https://github.com/gitpython-developers
GitPythonhttps://github.com/gitpython-developers/GitPython
Please reload this pagehttps://github.com/gitpython-developers/GitPython/issues/657
Notifications https://github.com/login?return_to=%2Fgitpython-developers%2FGitPython
Fork 964 https://github.com/login?return_to=%2Fgitpython-developers%2FGitPython
Star 5k https://github.com/login?return_to=%2Fgitpython-developers%2FGitPython
Code https://github.com/gitpython-developers/GitPython
Issues 169 https://github.com/gitpython-developers/GitPython/issues
Pull requests 8 https://github.com/gitpython-developers/GitPython/pulls
Discussions https://github.com/gitpython-developers/GitPython/discussions
Actions https://github.com/gitpython-developers/GitPython/actions
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/gitpython-developers/GitPython/security
Please reload this pagehttps://github.com/gitpython-developers/GitPython/issues/657
Insights https://github.com/gitpython-developers/GitPython/pulse
Code https://github.com/gitpython-developers/GitPython
Issues https://github.com/gitpython-developers/GitPython/issues
Pull requests https://github.com/gitpython-developers/GitPython/pulls
Discussions https://github.com/gitpython-developers/GitPython/discussions
Actions https://github.com/gitpython-developers/GitPython/actions
Security https://github.com/gitpython-developers/GitPython/security
Insights https://github.com/gitpython-developers/GitPython/pulse
New issuehttps://github.com/login?return_to=https://github.com/gitpython-developers/GitPython/issues/657
New issuehttps://github.com/login?return_to=https://github.com/gitpython-developers/GitPython/issues/657
#658https://github.com/gitpython-developers/GitPython/pull/658
[GitPython >= 2.1.4] Can't import without git CLIhttps://github.com/gitpython-developers/GitPython/issues/657#top
#658https://github.com/gitpython-developers/GitPython/pull/658
https://github.com/terminalmage
https://github.com/terminalmage
terminalmagehttps://github.com/terminalmage
on Aug 10, 2017https://github.com/gitpython-developers/GitPython/issues/657#issue-249477375
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.