At 01:48 AM 10/8/2007 -0400, The Cadet wrote:
>I checked the docs at
>http://peak.telecommunity.com/DevCenter/EasyInstall , but the only
>mention of ``--help-commands`` was in the 0.6a10 section where it said
>"Fixed the annoying --help-commands wart.". No idea what that means.
The wart is that --help-commands is ever displayed in the first
place, because it's a distutils command that easy_install doesn't support.
In other words, --help-commands really isn't a valid option to
easy_install; never was and never will be. However, it appears that
there is distutils code that was added in Python 2.5 that displays it
even when I'm trying to prevent it from doing so. (If you run
easy_install for Python 2.3 or 2.4, the --help-commands option doesn't appear.)
I'll look into suppressing the output from Python 2.5, especially
since it lists additional options that don't make sense for easy_install.
Hello!
I noticed a small problem in setuptools... workingenv (version 0.6.5-py2.4),
in some instances, adds a comment-line "# Duplicating setuptools' site.py..."
into the beginning of site.py (workingenv.py, line 1214). Problem is that
easy_install.py checks if the existing file site.py starts with "def
__boot():", and if it doesn't, it raises an error.
I fixed the problem in my own environment by skipping empty and
comment-lines in easy_install.py (fixed file attached).
I just thought to inform you of the problem... feel free to take my fix into
setuptools if you like my way to fix the problem.
Best regards,
Lauri Hallila
Hi,
I wanted to get more help on the command line for ``easy_install``
commands. Running ``easy_install --help`` tells me::
Common commands: (see '--help-commands' for more)
but the ``--help-commands`` option does not seem to work::
$ easy_install --help-commands
usage: easy_install [options] requirement_or_url ...
or: easy_install --help
error: option --help-commands not recognized
I'm using ``setuptools-0.6c7-py2.5.egg``.
Is this something that's already been fixed?
I checked the docs at
http://peak.telecommunity.com/DevCenter/EasyInstall , but the only
mention of ``--help-commands`` was in the 0.6a10 section where it said
"Fixed the annoying --help-commands wart.". No idea what that means.
Thanks.
At 05:01 PM 10/7/2007 -0500, Mike wrote:
>Ok. I uninstalled everything related to Python including my ctypes and
>wxPython installations. I reinstalled Python 2.4.3 and setuptools
>0.6c7. It still gives me the TypeError as before.
>
>Also, now it won't recognize "python" as a command name. While I can
>start python's command line terminal by going to Start, Run, and
>typing "python", if I open a command window and type the following:
>
>python setup.py bdist_wininst
>
>I get
>
>'python' is not recognized as an internal or external command,
>operable program or batch file.
>
>Unless I actually type out the path to the python executable. Maybe
>there's something wrong with the PyCrypto module itself.
It works fine for me. What's appears to be wrong is that you have
(or had) more than one Python installation, and I suspect the one you
uninstalled was not the one that you were using.
> I don't know.
>I guess I'll post this to the c.l.py group too.
I wouldn't bother until you find out what other Python(s) are
installed on your system and get clear about which ones you're
running. I tried installing PyCrypto from the same page you spoke
of, and it worked fine for me using Python 2.4 on Windows.
At 11:55 AM 10/7/2007 -0500, Mike wrote:
>On 10/7/07, Phillip J. Eby <pje(a)telecommunity.com> wrote:
> > Try this:
> >
> > python -c "import distutils; print distutils.__version__,
> distutils.__file__"
> >
> > This should print a version and a filename. The filename should be
> > something like 'c:\Python24\Lib\distutils\...' (*without*
> > site-packages between the Lib and distutils), and the version should
> > be 1.0.3 or higher.
> >
> > If the location is different, you haven't uninstalled it
> > correctly. If the location is correct but the version is less than
> > 1.0.3, you installed the distutils over the version that came with
> > Python, and will have to reinstall Python to fix it.
> >
> >
>
>Here is what was returned:
>
>2.4.1 L:\Python24\lib\distutils\__init__.py
Then this version of Python should have a usable version of the distutils.
>I did notice that if I try running Python from the command line, it
>loads the ActiveState version of Python 2.4.3 rather than the "normal"
>2.4.3 version. I don't suppose that could be the problem, could it?
Since I don't know what pythons you've been running for what, I have no idea.
At 07:05 AM 10/7/2007 -0500, Mike wrote:
>Phillip,
>
>On 10/6/07, Phillip J. Eby <pje(a)telecommunity.com> wrote:
> > At 02:25 PM 10/6/2007 -0500, Mike wrote:
> > >Hi,
> > >
> > >That's what I thought, but before I installed the distutils package
> > >manually, I got this:
> > >
> > >L:\Temp\pycrypto-2.0.1>python setup.py
> > >Traceback (most recent call last):
> > > File "setup.py", line 8, in ?
> > > from setuptools import setup
> > >ImportError: No module named setuptools
> > >
> > >
> > >And I get that now that I've deleted the distutils-egg file. Do I need
> > >to download setuptools from some place?
> >
> > Distutils comes with Python, setuptools does not. For setuptools
> > installation info, see:
> >
> > http://pypi.python.org/pypi/setuptools
> >
>
>I'm usually not this dense when it comes to Python. I'm just new to
>the distribution process. I did as you said and now I'm back to the
>first error I posted. I deleted the distutils-egg and the
>setuptools-egg directories.
Try this:
python -c "import distutils; print distutils.__version__, distutils.__file__"
This should print a version and a filename. The filename should be
something like 'c:\Python24\Lib\distutils\...' (*without*
site-packages between the Lib and distutils), and the version should
be 1.0.3 or higher.
If the location is different, you haven't uninstalled it
correctly. If the location is correct but the version is less than
1.0.3, you installed the distutils over the version that came with
Python, and will have to reinstall Python to fix it.
At 02:25 PM 10/6/2007 -0500, Mike wrote:
>Hi,
>
>That's what I thought, but before I installed the distutils package
>manually, I got this:
>
>L:\Temp\pycrypto-2.0.1>python setup.py
>Traceback (most recent call last):
> File "setup.py", line 8, in ?
> from setuptools import setup
>ImportError: No module named setuptools
>
>
>And I get that now that I've deleted the distutils-egg file. Do I need
>to download setuptools from some place?
Distutils comes with Python, setuptools does not. For setuptools
installation info, see:
http://pypi.python.org/pypi/setuptools
At 08:16 AM 10/6/2007 -0500, Mike wrote:
>I was typing out the distutils package this morning and hit a wall
>within a few minutes of running it.
The current version of distutils is already included with every
version of Python; you just installed a broken out-of-date version of
them. Delete what you installed (presumably a distutils-*.egg file
or directory), and your system should work again.
Hi,
I was typing out the distutils package this morning and hit a wall
within a few minutes of running it. I got it using the "Easy Install"
script found here:
http://peak.telecommunity.com/DevCenter/EasyInstall#installing-easy-install
To test the package, I tried using it on PyCrypto, found here:
http://www.amk.ca/python/code/crypto.html
After unzipping that package to a temporary directory, I ran distutils
from the command line as follows:
L:\Temp\pycrypto-2.0.1>python setup.py bdist_wininst
Here's the traceback that gave me:
L:\Temp\pycrypto-2.0.1>python setup.py bdist_wininst
running bdist_wininst
running build
running build_py
running build_ext
Traceback (most recent call last):
File "setup.py", line 164, in ?
core.setup(**kw)
File "L:\Python24\lib\distutils\core.py", line 149, in setup
dist.run_commands()
File "L:\Python24\lib\distutils\dist.py", line 946, in run_commands
self.run_command(cmd)
File "L:\Python24\lib\distutils\dist.py", line 966, in run_command
cmd_obj.run()
File "l:\python24\lib\site-packages\setuptools-0.6c7-py2.4.egg\setuptools\comm
and\bdist_wininst.py", line 37, in run
_bdist_wininst.run(self)
File "L:\Python24\lib\distutils\command\bdist_wininst.py", line 107, in run
self.run_command('build')
File "L:\Python24\lib\distutils\cmd.py", line 333, in run_command
self.distribution.run_command(command)
File "L:\Python24\lib\distutils\dist.py", line 966, in run_command
cmd_obj.run()
File "L:\Python24\lib\distutils\command\build.py", line 112, in run
self.run_command(cmd_name)
File "L:\Python24\lib\distutils\cmd.py", line 333, in run_command
self.distribution.run_command(command)
File "L:\Python24\lib\distutils\dist.py", line 966, in run_command
cmd_obj.run()
File "L:\Python24\lib\distutils\command\build_ext.py", line 279, in run
self.build_extensions()
File "setup.py", line 117, in build_extensions
build_ext.build_extensions(self)
File "L:\Python24\lib\distutils\command\build_ext.py", line 402, in build_exte
nsions
self.check_extensions_list(self.extensions)
File "L:\Python24\lib\distutils\command\build_ext.py", line 304, in check_exte
nsions_list
(ext_name, build_info) = ext
TypeError: unpack non-sequence
The only information I can find about this is an ongoing dispute about
some Pyrex version causing this issue:
http://mail.python.org/pipermail/distutils-sig/2007-September/008211.html
I am using Python 2.4, NOT Pyrex. I am on Windows XP 2. Any help would
be appreciated.
Mike
Folks:
We're gradually converting the allmydata.org tahoe project [1] and
its spin-off packages to use setuptools. One problem that comes up
is that ez_setup.py might require a newer version of setuptools than
the version of setuptools already installed.
For example, although Tahoe currently uses setuptools to manage its
dependencies on zfec, foolscap, and nevow [2], but if we execute
simplejson's ez_setup.py then it requires setuptools v0.6c7 and
refuses to proceed if an earlier version is installed.
One solution for this problem could be for the packager of simplejson
(Bob Ippolito) to use the "min_version" patch that we contributed to
ez_setup.py [3]. This is assuming that simplejson doesn't actually
*require* the latest version of setuptools, and we could successfully
install with a slightly older version, but what if a package actually
does require a newer version of setuptools than the one that is
already installed?
The following patch was created by Tahoe contributor Arno Washck and
then modified by me in order to get around such a problem. The idea
is simple enough -- reload setuptools. There may be some subtleties
that we still need to work out. This patch hasn't been tested in its
current form.
--- ez_setup.py~ 2007-09-10 12:36:30.000000000 -0600
+++ ez_setup.py 2007-09-18 15:15:23.000000000 -0600
@@ -95,13 +95,9 @@
pkg_resources.require("setuptools>="+version)
except pkg_resources.VersionConflict, e:
- # XXX could we install in a subprocess here?
- print >>sys.stderr, (
- "The required version of setuptools (>=%s) is not
available, and\n"
- "can't be installed while this script is running. Please
install\n"
- " a more recent version first.\n\n(Currently using %r)"
- ) % (version, e.args[0])
- sys.exit(2)
+ egg = download_setuptools(version, download_base, to_dir,
download_delay)
+ sys.path.insert(0, egg)
+ reload(setuptools); setuptools.bootstrap_install_from = egg
def download_setuptools(
version=DEFAULT_VERSION, download_base=DEFAULT_URL,
to_dir=os.curdir,
-------
An alternative idea figure out the version of the current install of
setuptools without importing the package. The following patch might
accomplish that. It is also not tested.
--- ez_setup.py~ 2007-09-10 12:36:30.000000000 -0600
+++ ez_setup.py 2007-09-18 15:26:50.000000000 -0600
@@ -77,31 +77,13 @@
this routine will print a message to ``sys.stderr`` and raise
SystemExit in
an attempt to abort the calling script.
"""
- try:
- import setuptools
- if setuptools.__version__ == '0.0.1':
- print >>sys.stderr, (
- "You have an obsolete version of setuptools installed.
Please\n"
- "remove it from your system entirely before rerunning
this script."
- )
- sys.exit(2)
- except ImportError:
- egg = download_setuptools(version, download_base, to_dir,
download_delay)
- sys.path.insert(0, egg)
- import setuptools; setuptools.bootstrap_install_from = egg
-
+ verstr = os.system("python -c \"import setuptools;print
setuptools.__version__\"")
import pkg_resources
- try:
- pkg_resources.require("setuptools>="+version)
- except pkg_resources.VersionConflict, e:
- # XXX could we install in a subprocess here?
- print >>sys.stderr, (
- "The required version of setuptools (>=%s) is not
available, and\n"
- "can't be installed while this script is running. Please
install\n"
- " a more recent version first.\n\n(Currently using %r)"
- ) % (version, e.args[0])
- sys.exit(2)
+ if pkg_resources.parse_version(verstr) <
pkg_resources.parse_version(version):
+ egg = download_setuptools(version, download_base, to_dir)
+ sys.path.insert(0, egg)
+ import setuptools; setuptools.bootstrap_install_from = egg
def download_setuptools(
version=DEFAULT_VERSION, download_base=DEFAULT_URL,
to_dir=os.curdir,
-------
Regards,
Zooko
[1] http://allmydata.org
[2] http://allmydata.org/trac/tahoe/browser/calcdeps.py
[3] http://mail.python.org/pipermail/distutils-sig/2007-September/
008257.html