Re: [Pythonmac-SIG] why does the Mac installer hack the user's .bash_profile?

2011-04-11 Thread Ronald Oussoren

On 8 Apr, 2011, at 0:56, Russell E. Owen wrote:

 In article 64461.1302209...@parc.com, Bill Janssen jans...@parc.com 
 wrote:
 
 I've got a Snow Leopard buildslave I'm trying to debug.  So I thought
 I'd try Python 2.7 on it.  Normally, I advise people to never try to
 install a different Python on a Mac, as it's too embedded in the OS to
 do safely, without a great deal of domain knowledge.  But here, I
 figured I could always wipe the disk and start over without too much
 loss.
 
 So I ran the installer, and tried a few things, and it didn't solve my
 buildbot problems.  So I decided to go back to the original System
 python.  But now I find that the installer has put the 2.7 Python on my
 PATH?!?  It does this apparently by hacking ~/.bash_profile.  In there,
 there's a line saying
 
  The original version is saved in .bash_profile.pysave
 
 a file which doesn't seem to exist.
 
 So, why didn't I notice myself checking the checkbox to do this in the
 first place, and where is my original .bash_profile file?
 
 I'm surprised you can't find it. I've always had it saved on some 
 obvious place. But I agree that hacking the file is ugly -- it least it 
 could ask.

Feel free to file a bug and attach a patch that does this. 

 
 In any case you can revert by just deleting the extra lines.
 
 Other gripes about the installer:
 - It names the version explicitly instead of using the Current symlink 
 (/Libraries/Packages/Python.Package/Versions/Current).

That's intentional, if you install 2.6 with the default settings and 2.7 with 
the 'update shell profile' section disabled you'd want python 2.6 to be on 
$PATH while 2.7 shouldn't be. This cannot be done without hardcoding version.

 - It hacks the file even if doesn't need to (e.g. if Current is already 
 on the $PATH then the new python will be found; I think that would be 
 easy to check).

That's a bug, please file a report at bugs.python.org.

 - It adds a bunch of links to /usr/local/bin even though that is 
 redundant with putting Python's bin directory on the $PATH. This makes 
 it a headache to switch Python versions -- something developers often 
 need to do when testing compatibility.

This behavior can be disabled when you run the installer. I agree that the 
default should be to not install files in /usr/local, although we have had 
users that complained that the 3.x installers didn't do this.

BTW. I've talked with Ned about this feature at Pycon and we'd like to move to 
a python-select command that gives you a command-line tool for managing the 
path to the current python (simular to gcc-select or xcode-select).   That way 
it should be possible to do away with automaticly patching the shell profile.

Ronald
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG


Re: [Pythonmac-SIG] py2app + wxpython - ImportError

2011-04-11 Thread Ronald Oussoren

On 10 Apr, 2011, at 10:06, Christian K. wrote:

 Hi,
 
 I tried to make an app using py2app on OSX 10.6.5, python 2.6.5,
 wxpython 2.8.11.0
 Building works, but when running I get
 
 File wx/lib/pubsub/pub.pyc, line 24, in module
 File wx/lib/pubsub/core/listener.pyc, line 13, in module
 ImportError: No module named listenerimpl
 
 I had (other) problems with pubsub using py2exe, too, and I needed to add
 'wx.lib.pubsub' to the 'package' section of the setup options dict. That did
 not help py2app though.
 
 Any ideas?

Adding includes=['wx.lib.pubsub'] could help.

Ronald
 
 Regards, Christian
 
 
 ___
 Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
 http://mail.python.org/mailman/listinfo/pythonmac-sig
 unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG

___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG


Re: [Pythonmac-SIG] why does the Mac installer hack the user's .bash_profile?

2011-04-11 Thread Bill Janssen
Ronald Oussoren ronaldousso...@mac.com wrote:

 BTW. I've talked with Ned about this feature at Pycon and we'd like to
 move to a python-select command that gives you a command-line tool for
 managing the path to the current python (simular to gcc-select or
 xcode-select).  That way it should be possible to do away with
 automaticly patching the shell profile.

How about a Preference Pane?  I could probably remember how to code one
up with PyObjC and Python.

Bill
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG


Re: [Pythonmac-SIG] why does the Mac installer hack the user's .bash_profile?

2011-04-11 Thread Ronald Oussoren

On 11 Apr, 2011, at 17:13, Bill Janssen wrote:

 Ronald Oussoren ronaldousso...@mac.com wrote:
 
 BTW. I've talked with Ned about this feature at Pycon and we'd like to
 move to a python-select command that gives you a command-line tool for
 managing the path to the current python (simular to gcc-select or
 xcode-select).  That way it should be possible to do away with
 automaticly patching the shell profile.
 
 How about a Preference Pane?  I could probably remember how to code one
 up with PyObjC and Python.

A preference pane would work as well. It would need to be writting in 
Objective-C though, both because PyObjC is not part of the stdlib and because 
PyObjC plugins are not (and cannot be) isolated from each other very well. 

I'd prefer to have a solution that works from the command-line as well (for 
power-users and for integration with other tools)

Ronald

___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG


Re: [Pythonmac-SIG] py2app + wxpython - ImportError

2011-04-11 Thread Christian K.

Am 11.04.11 08:08, schrieb Ronald Oussoren:


On 10 Apr, 2011, at 10:06, Christian K. wrote:



File wx/lib/pubsub/pub.pyc, line 24, inmodule
File wx/lib/pubsub/core/listener.pyc, line 13, inmodule
ImportError: No module named listenerimpl

I had (other) problems with pubsub using py2exe, too, and I needed to add
'wx.lib.pubsub' to the 'package' section of the setup options dict. That did
not help py2app though.

Any ideas?


Adding includes=['wx.lib.pubsub'] could help.



Thanks, but that did not change anything.

Christian

___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG


Re: [Pythonmac-SIG] py2app + wxpython - ImportError

2011-04-11 Thread Christian K.

Am 10.04.11 22:12, schrieb Aahz:

On Sun, Apr 10, 2011, Christian K. wrote:


I tried to make an app using py2app on OSX 10.6.5, python 2.6.5,
wxpython 2.8.11.0
Building works, but when running I get

File wx/lib/pubsub/pub.pyc, line 24, inmodule
File wx/lib/pubsub/core/listener.pyc, line 13, inmodule
ImportError: No module named listenerimpl


Do you have this problem with a simple test app?  Are any of your
imports inside ``if`` blocks or function calls?


No, I import it like this:

from wx.lib.pubsub import setuparg1
from wx.lib.pubsub import pub as Publisher

The first line is important for freezing with py2exe on windows.

Christian


___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG