Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8004117
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T16:49:53+00:00 2026-06-04T16:49:53+00:00

I am using GitPython to fetch a remote repository to my machine. The following

  • 0

I am using GitPython to fetch a remote repository to my machine. The following code works well on my Ubuntu 12.04 but on my amazon ec2, on a Ubuntu 11.10 server, I get the OSError: [Errno 2] No such file or directory error.

    repo = git.Repo.init(fs_path)
    origin = repo.create_remote('origin',repo_url)
    origin.fetch()
    origin.pull(origin.refs[0].remote_head)

When I run the block in a script, I don’t get any error messages. But when I try these steps on Interactive shell I get this stack trace:

>>> import git
>>> repo = git.Repo.init("/var/wwww/dir/subdir/tmp/12")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/GitPython-0.3.2.RC1-py2.7.egg/git/repo/base.py", line 656, in init
    output = git.init(**kwargs)
  File "/usr/local/lib/python2.7/dist-packages/GitPython-0.3.2.RC1-py2.7.egg/git/cmd.py", line 227, in <lambda>
    return lambda *args, **kwargs: self._call_process(name, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/GitPython-0.3.2.RC1-py2.7.egg/git/cmd.py", line 456, in _call_process
    return self.execute(call, **_kwargs)
  File "/usr/local/lib/python2.7/dist-packages/GitPython-0.3.2.RC1-py2.7.egg/git/cmd.py", line 335, in execute
    **subprocess_kwargs
  File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1239, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory
>>> 

But I have no such issues on my local machine. No idea what’s going wrong. Any help will be highly appreciated!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T16:49:55+00:00Added an answer on June 4, 2026 at 4:49 pm

    The error is coming out of the subprocess module. This suggests that git is either not installed on your EC2 instance or is in a location that is not in your PATH environment variable.

    Note that GitPython depends on the git command-line tools. If you want a native Python module for interacting with Git repositories, take a look at dulwich.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using LINQ on collections, what is the difference between the following lines of code?
Using emacs on Ubuntu 11.10. I want to connect to a SQL Server database
Using this code, the following execution yields strange results: C 100 R W The
Using Rails 3.2.0.rc2 and ruby 1.9.3p0 In app/views/requests/_form.html.erb I have the following code for
Using the C# Facebook SDK 5.0.3 everything works fine whit the client.Get(/me). But when
I'm using the GitPython package to access a Git repository from Python. This pulls
Using DMD 2.057, I cannot get the following code to compile: import std.stdio; import
Using top it's easy to identify processes that are hogging memory and cpu, but
Using the navigator.geolocation object in JavaScript. Trying to establish accurate ranges, but wondering exactly
Using NSDateComponents I know how to get the day component, but this gives me

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.