Hey! I need to check out something via git, so i downloaded mercurial and the git extension. It fails to install though?
9.RAM Disk:mercurial-1.9> python setup.py install running install running build running build_mo Traceback (most recent call last): File "setup.py", line 441, in <module> **extra) File "PYTHON:Lib/distutils/core.py", line 151, in setup dist.run_commands() File "PYTHON:Lib/distutils/dist.py", line 974, in run_commands self.run_command(cmd) File "PYTHON:Lib/distutils/dist.py", line 994, in run_command cmd_obj.run() File "PYTHON:Lib/distutils/command/install.py", line 514, in run self.run_command('build') File "PYTHON:Lib/distutils/cmd.py", line 333, in run_command self.distribution.run_command(command) File "PYTHON:Lib/distutils/dist.py", line 994, in run_command cmd_obj.run() File "PYTHON:Lib/distutils/command/build.py", line 112, in run self.run_command(cmd_name) File "PYTHON:Lib/distutils/cmd.py", line 333, in run_command self.distribution.run_command(command) File "PYTHON:Lib/distutils/dist.py", line 994, in run_command cmd_obj.run() File "setup.py", line 193, in run if not find_executable('msgfmt'): File "PYTHON:Lib/distutils/spawn.py", line 214, in find_executable path = os.environ['PATH'] File "PYTHON:Lib/UserDict.py", line 22, in __getitem__ raise KeyError(key) KeyError: 'PATH'
I'm not a Python expert, but trying to learn a bit now and then.
As far as I can tell, the problem is that find_executable in spawn.py expects the command path to be in an environment variable called PATH (as it is in Windows and Linux, at least). This is not true in AmigaOS.
You should probably report this over on the Hyperion forum. There are bound to be people with more Python insight than mine, and maybe e.g. ssolie can determine whether this should be fixed in AmigaOS' Python, or it is an error in the installation script.
You may be able to create a workaround by doing a "setenv PATH `path`"? Not sure if this will be parsed as expected, but it's worth a shot.
(Come to think of it, maybe AmigaOS should play nice and have the Path command always maintain a PATH env variable for cross-platform compatibility?)
As nbache says this is down to python expecting PATH to be set, or at least many python scripts and modules expect os.environ['PATH'] which maps to ENV:PATH
I have the PATH variable set here (for use with abc-shell) so didn't notice it. (well actually you get a bunch of insrt volume requesters as the python uses a different pathseperator ',' instead of ':')
I have a BZ open on it
The following code snippet will create a suitable path.
import os
import string
handle = os.popen('path')
if handle:
path = handle.read().split('\\n')
handle.close()
# first element is always "current directory" so replace with CURRDIR:
path[0] = "CURRDIR:"
os.environ['PATH'] = string.join(path,os.pathsep)
print os.environ['PATH']
Edited by broadblues on 2012/4/6 15:50:19 Edited by broadblues on 2012/4/6 15:54:07
If your path is fairly constant (usually is) then you could just paste it into text editor save as pathmake.py set the script bit and do
setenv save PATH `pathmaker.py`
in that case ofcourse you do need the last print statement
That might cause an issue if you use anc-shell though, so swings and roundabouts, idaelly it need to be fixed in python. and as I said I do have a bug report open onit.
I hope we will get a fix for it with the next SDK.
This is a little bit too much workaround even for me
I have PATH set to "/gcc/bin:/SDK/C:/SDK/Local/C:/SDK/Local/newlib/bin:/SDK/Local/clib2/bin:/C:" and still get sometimes requesters from scripts/projects.
@broadblues
What about a new mercurial/hg version? I tried myself but as i wrote i went back to your version because of lots of miscief :-/
I hope we will get a fix for it with the next SDK.
Python isn't part of the SDK it's part of AmigaOS (it's in sys:system/python)
Quote:
I have PATH set to "/gcc/bin:/SDK/C:/SDK/Local/C:/SDK/Local/newlib/bin:/SDK/Local/clib2/bin:/C:" and still get sometimes requesters from scripts/projects.
That path is suitable for a program such as abc-shell using linux paths, it won't work for Python that uses AmigaOS Path.
Quote:
What about a new mercurial/hg version? I tried myself but as i wrote i went back to your version because of lots of miscief :-/
Don't really have time at the moment, and I don't see the need for it. Unless there are significant cases where its failing in regular use, why upgrade for the sake of it?
I hope we will get a fix for it with the next SDK.
Python isn't part of the SDK it's part of AmigaOS (it's in sys:system/python)
Quote:
I have PATH set to "/gcc/bin:/SDK/C:/SDK/Local/C:/SDK/Local/newlib/bin:/SDK/Local/clib2/bin:/C:" and still get sometimes requesters from scripts/projects.
That path is suitable for a program such as abc-shell using linux paths, it won't work for Python that uses AmigaOS Path.
I see, misunderstanding from my side then, sorry
Quote:
Quote:
What about a new mercurial/hg version? I tried myself but as i wrote i went back to your version because of lots of miscief :-/
Don't really have time at the moment, and I don't see the need for it. Unless there are significant cases where its failing in regular use, why upgrade for the sake of it?
Bugfixes (under the hood) and new features (especially more options supported in the hg-git part)
But of course i understand the time issues, just wanted to nudge you again