[arch-general] a plea for python 2

Bjørn Øivind Bjørnsen bo.bjornsen at gmail.com
Thu Dec 15 02:32:08 EST 2011


On 15/12/11 05:57, Angel Velásquez wrote:
> On 14/12/11 19:24, Evan Martin wrote:
> <snip>
> 
>> 1) Is it intentional that I am unable to use software from
>> upstream like Django unmodified?  Am I expected to only install
>> software from the Arch repositories, where it has been patched by
>> Arch devs to work on Arch? (See below for more on Django.)
> 
> 
> As a python developer i wonder why you don't use virtualenv [1]?
> virtualenv will solve you many problems, not only in Arch, for your
> development work with out-of-date or too updated python and libraries,
> after do the hello world, and run the pep8 the next step for a python
> developer should be to use virtualenv, in order to have best practices.
> 
> 
>> 2) Should I change the software I write to attempt to detect when
>> I'm on an Arch system and adjust scripts/etc. accordingly? (I can't
>> just "fix it" because there is no /usr/bin/python2 on existing
>> systems like Macs.)
> 
> Again use virtualenvs [1] for your python development
> 
> [1] http://pypi.python.org/pypi/virtualenv
> 

While virtualenv is by far the best approach to this if you do any kind
of serious python work, I might add that a simple $PATH trick also works
if you need something up and running *now*.

Here's the approach I used when mucking about with openembedded:

[bo at archawesome at91sam9m10-g45-ek Thu 08:25 ]$ ls python-bin/
total 0
lrwxrwxrwx 1 bo users 16 Oct 28 16:03 python -> /usr/bin/python2*

[bo at archawesome at91sam9m10-g45-ek Thu 08:25 ]$ cat env.sh
#!/bin/sh

# source me.

export BBPATH="${PWD}/build:${PWD}/openembedded"
# to make sure python is python2 we do this PATH hack
export PATH="${PWD}/python-bin:${PATH}"

Worked well enough for that particular purpose - seeing if I could make
it run at all. If this were a real product, I'd probably lean towards
learning virtualenv sooner rather than later :)

Regards,
Bjørn Øivind

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 900 bytes
Desc: OpenPGP digital signature
URL: <http://mailman.archlinux.org/pipermail/arch-general/attachments/20111215/ec80c919/attachment.asc>


More information about the arch-general mailing list