Code Monkey home page Code Monkey logo

Comments (3)

jpgrayson avatar jpgrayson commented on September 1, 2024

I was unable to reproduce this problem.

You are running with sudo. Is /usr/local/bin in the path when running with sudo?

Also, which version of Python are you running? I verified with several versions.

Could you add a line to __check_git_version() to print-out PATH as setup.py sees it? I.e.:

def __check_git_version():
    ...
    print('PATH:', os.environ['PATH'])
    ...

If all that doesn't reveal the root cause, could you bisect to figure out which commit introduced the problem?

from stgit.

chucklever avatar chucklever commented on September 1, 2024
[cel@klimt stgit]$ sudo python setup.py install
PATH: /sbin:/bin:/usr/sbin:/usr/bin
Traceback (most recent call last):
  File "setup.py", line 67, in <module>
    __check_git_version()
  File "setup.py", line 55, in __check_git_version
    gitver = Run('git', '--version').output_one_line().split()[2]
  File "/home/cel/src/stgit/stgit/run.py", line 262, in output_one_line
    outlines = self.output_lines(sep)
  File "/home/cel/src/stgit/stgit/run.py", line 253, in output_lines
    outdata = self._run_io()
  File "/home/cel/src/stgit/stgit/run.py", line 151, in _run_io
    raise self.exc('%s failed: %s' % (self._cmd[0], e))
stgit.run.RunException: git failed: [Errno 2] No such file or directory
[cel@klimt stgit]$ sudo echo $PATH
/home/cel/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin
[cel@klimt stgit]$ sudo su
[root@klimt stgit]# echo $PATH
/sbin:/bin:/usr/sbin:/usr/bin
[root@klimt stgit]#

It appears that /usr/local/bin is not in root's path.

from stgit.

jpgrayson avatar jpgrayson commented on September 1, 2024

Note that sudo echo $PATH is not telling you the effective PATH used by sudo since $PATH is expanded using your regular user's environment before sudo is run.

Instead, use sudo env | grep PATH or sudo $SHELL -c 'echo $PATH' (with single-quotes so that $PATH is not expanded early).

One possible solution: try sudo -E which preserves your user environment in the sudo environment. Although the sudo man page indicates that PATH is already transferred, unchanged, into the sudo environment. You can test whether sudo -E env | grep PATH produces a different path than without -E.

Since this problem appears to be outside StGit's control, I'm going to close this issue.

from stgit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.