[Pythonmac-SIG] Teething troubles - Getting up an running on a mac

Christopher Barker Chris.Barker at noaa.gov
Mon Aug 4 21:15:36 CEST 2008


Kevin Walzer wrote:
>> Item 2. I downloaded and installed the SciPy superpack from
>> Macinscience,org. Scipy seems to import correctly into the Python 
>> 2.5.1 that
>> comes with the Mac, but i cannot import it into MacPython 2.5.2.
> 
> Looks like it works with the System Python, not the one you installed?

The Superpack is supposed to install into either one. I think the key is 
to make sure that MacPython is the default one on your path before 
installing the superpack. What do you get if you type:

$ which python

At the command line? I get:

/Library/Frameworks/Python.framework/Versions/Current/bin/python

which is python.org python.

You can also try:

 >>> import datetime
 >>> datetime.__file__
'/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload/datetime.so'

to see which python you are running -- the above is from python.org python

>> Question 3. What do I have to do in order to make SciPy work with both
>> Python 2.5.1 (that comes with the Mac) and 2.5.2 (that I installed 
>> myself)?

You may be able to install it in both places, but that can get ugly -- 
just choose one (and if you listen to me, you'll choose python.org version)

>> Item 3. I accidentally clicked on something (not sure what) and suddenly
>> found the path to the numpy folder was Macintosh HD > Developer > SDKs >
>> MacOSX10.5.sdk>System>
>> Library>Frameworks>Python.framework>Versions>2.5>extras>lib>Python>numpy.
>> This is insane!!!

It does seem so, but that may be their trick to get it seen by either 
version. wxPython installs into /usr/local/lib/, so that both pythons 
can see it.

Another option is to check out the Enthought Python Distribution. I 
haven't tried it yet, but there is a lot of nice stuff in there.

>> Question 4. How do I get MacPython 2.5.2 to see SciPy, NumPy etc.
>> Question 5. How can I find the current value of the PYTHONPATH 
>> environment variable,

echo $PYTHONPATH

>> and how can I edit it and add a directory in which I keep my
>> Python programs.

change it in your .profile folder. However, I have never needed to use 
it -- are you sure you do? If you have a bunch of your own pacakges, you 
might want to install them with:

easy_install develop

which seems less fragile than PYTHONPATH.

>> Question 6. Apparently there's a Property List Editor that must be 
>> used to
>> create a file called ~ /.MacOSX/environment.plist. I can't find a 
>> directory

I've never gotten this to work, but you're right, that's supposed to be 
how you can set an environment variable that will be seen everywhere, 
even outside of a login shell.

>> called ~/.MacOSX. Is this a hidden directory?

I recommend you figure out how to set the Finder to show hidden files -- 
it's really handy. I did it with a utility called "Tinker Tool" or 
something like that.


>> I never thought I'd say this, but it actually seemed a lot easier to get
>> Python and any associated programs up and running on Windows!

>  It isn't the same as Windows and other Unixes, so it's not surprising 
> that you're having some difficulty adjusting to the platform-specific 
> quirks.Once you work through them, things should be smooth.

Yes, but it really is a lot harder -- why? because There are WAY TOO 
MANY ways to get Python on the Mac. Almost everyone uses python.org on 
Windows (with a few using ActiveState, though they are very compatible), 
so that's what you do and you're done.

On the Mac, there is Apple's python, python.org's, fink, macports, 
build-your-own, ..... Then you have PPC, and Intel, and it's really a mess.

Can't we all just agree on using the python.org one?

Oh well,

-Chris


-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov


More information about the Pythonmac-SIG mailing list