From: Eric Mangold <teratorn@gm...> - 2008-05-17 10:39:33
I'm trying to use Distutils under SVN Jython, but it seems to be
broken very badly. I have a very simple setup.py, and I get the
following error when I try to install it:
% jython setup.py install --prefix=tmp
*sys-package-mgr*: can't create package cache dir,
Traceback (most recent call last):
File "setup.py", line 14, in <module>
File "/usr/share/jython/Lib/distutils/core.py", line 135, in setup
ok = dist.parse_command_line()
File "/usr/share/jython/Lib/distutils/dist.py", line 422, in
args = self._parse_command_opts(parser, args)
File "/usr/share/jython/Lib/distutils/dist.py", line 469, in
cmd_class = self.get_command_class(command)
File "/usr/share/jython/Lib/distutils/dist.py", line 770, in get_command_class
File "/usr/share/jython/Lib/distutils/command/install.py", line 15,
from distutils.sysconfig import get_config_vars
File "/usr/share/jython/Lib/distutils/sysconfig.py", line 29, in <module>
argv0_path = os.path.dirname(os.path.abspath(sys.executable))
File "/usr/share/jython/Lib/posixpath.py", line 410, in abspath
if not isabs(path):
File "/usr/share/jython/Lib/posixpath.py", line 51, in isabs
AttributeError: 'NoneType' object has no attribute 'startswith'
It blows up because sys.executable is None. Is that normal? Should
this work, or is Distutils know to be non-functional?
From: Philip Jenvey <pjenvey@un...> - 2008-05-17 22:56:57
On May 17, 2008, at 3:39 AM, Eric Mangold wrote:
> I'm trying to use Distutils under SVN Jython, but it seems to be
> broken very badly.
> It blows up because sys.executable is None. Is that normal? Should
> this work, or is Distutils know to be non-functional?
distutils should work fine with a valid sys.executable.
trunk supports a new command line option for specifying the
sys.executable value, it is: -Dpython.executable. We have to
explicitly pass this value to Jython because Java can't determine argv
Being that you're on POSIX, you'll want to modify your jython script
to do something like:
java -Dpython.executable="$0" org.python.util.jython "$@"
or -Dpython.executable="%0" on Windows.