[Python-Dev] Distutils2 scripts

Ron Adam rrr at ronadam.com
Thu Oct 21 03:01:56 CEST 2010



On 10/12/2010 09:59 AM, Barry Warsaw wrote:
> On Oct 12, 2010, at 12:24 PM, Greg Ewing wrote:
>
>> Giampaolo Rodolà wrote:
>>
>>> If that's the case what would I type in the command prompt in order to
>>> install a module?
>>> "C:\PythonXX\pysetup.exe"?
>>> If so I would strongly miss old "setup.py install".
>>
>> Another thing bothers me about this. With the current scheme,
>> if you have multiple Pythons available, it's easy to be sure
>> that you're installing into the right one, because it's the
>> one that you use to run setup.py. Whereas if installation is
>> performed by a different executable, there's a possibility
>> of them being out of sync.
>>
>> So I think I'd prefer some scheme involving 'python -m ...'
>> or some other option to Python itself, rather than a separate
>> executable.
>
> This is why I suggested that 'setup.sh' (or whatever) take a --python-version
> option to select the python executable to use.
>
> Whatever solution is implemented definitely needs to take the
> multiple-installed pythons into account.

On Ubuntu, I use python, python2.7, python3.1, python3.2 and that is what I 
type to use that particular version.  The -m option seems to me to be the 
easiest to do and works with all of these.

     python2.7 -m setup
     python3.2 -m setup

I don't see why that isn't an acceptable solution to this? <shrug>

It's not any different than doing ...

     python3.2 -m test.regrtest
     python3.2 -m pydoc -g
     python3.2 -m idlelib.idle
     python3.2 -m this
     python3.2 -m turtle
     python3.2 -m timeit -h
     python3.2 -m trace --help
     python3.2 -m dis filename.py
     python3.2 -m zipfile

There are probably others I don't remember or know about.

The point is, without the handy '-m', you have to know where the file is, 
or set environment variables, or create .bat and/or .sh files, and those 
takes a lot more work.  So why not just embrace it and move on?

Ron







More information about the Python-Dev mailing list