473,406 Members | 2,847 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Re: Teething troubles with Python on a Mac

Thomas Philips wrote:
Question 1: How can I locate the Python installation? There a few
files under Applications MacPython 2.5, but this is clearly not the
entire installation.
Have a look in

/Library/Frameworks/Python.framework/Versions/2.5
But I do not seem to
be able to see the sequence of folders under the horizontal scroll bar
in any finder window. What do I need to do to make the folder sequence
visible in all Finder Windows?
You can't -- this feature only exists in the Search window,
which is a different kind of window from the normal Finder
windows.

However, in a normal Finder window, if you click and hold
with the Command key on the title displayed in the title
bar at the top of the window, you'll get a pop-up menu
showing the position of the folder you're looking at in the
nesting hierarchy.
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.
I'm not familiar with SciPy distributions, but if it's some
sort of double-clickable installer, it's likely that it's only
designed to install into the system Python (i.e. the one that
comes installed with MacOSX).

See if it has installed anything into

/Library/Python/2.5/site-packages

If so, you could try moving or copying them into

/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages
Question 5. How can I find the current value of the PYTHONPATH
environment variable, and how can I edit it and add a directory in
which I keep my Python programs.
To find out its current value, in a Terminal window,

echo $PYTHONPATH

To have it set each time you open a Terminal window,
one way is to put something like this in your ~/.bashrc
file:

PYTHONPATH=whatever_you_want
export PYTHONPATH

However, because the filename starts with a dot, it
won't show up in the Finder or any Save dialog boxes,
making it a bit tricky to edit with a GUI-based text
editor. There's some advice here on how to deal with
that:

http://discussions.apple.com/thread....readID=1007602
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 called ~/.MacOSX. Is this a hidden directory?
I've never tried that method myself, but it sounds
plausible. You'll have similar difficulties with the
name .MacOSX not showing up in the Finder. However,
you can get to it using the "Go To Folder..." command
under the "Go" menu in the Finder and typing in the
full pathname.

If there isn't already an environment.plist file
there, you may have to save it somewhere else first
and then drag it into the .MacOSX folder.

The Property List Editor comes with the Developer
Tools and lives in /Developer/Applications/Utilities.
Item 4. I opened a terminal window, and typed ipython. Here's what I
got:

/Users/tom/.ipython
WARNING:
Installation error. IPython's directory was not found.
It's quite likely that this will correct itself once you
get the relevant files into the right site-packages folder.

Also, if this is your only reason for wanting to set
PYTHONPATH, you may not have to worry about that either.
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! I
suspect that a large fraction of my troubles are due to the fact that
I am brand new to the Mac and to Unix, but I bought the Mac in part
because I thought that using it was effortless.
It's generally pretty smooth (although different from Windows
in many ways, so you do need to learn some new things) as
long as you stick to GUI-style applications. Python doesn't
quite fit into that way of working, however. You need to
know a bit about what's going on underneath, particularly
when managing your own Python installation.

The way I approach Python on MacOSX is to treat it as a
Unix system and use the standard Python method of installing
packages, i.e. use Python to run a setup.py file. This
ensures that the package will be installed into whichever
Python is being used to run the setup.py.

Apart from the initial installation of Python itself, I
never use an installer to install a Python package if I
can avoid it. I wouldn't trust it to install into the right
Python version.

--
Greg
Aug 3 '08 #1
7 1604
Avi
Apart from the initial installation of Python itself, I
never use an installer to install a Python package if I
can avoid it. I wouldn't trust it to install into the right
Python version.
On that: how would I go about updating the system Python, then? Or is
that going to be stuck at whatever it is, and Mac users are expected
to run two simultaneous Python installations? I'm not entirely
comfortable with having a separate MacPython (I used to do so, but it
caused so many issues with installing new packages that I gave up on
it) and would prefer to just update system Python.

- Avi
Aug 3 '08 #2
On Sun, Aug 3, 2008 at 12:37 AM, Avi <av*********@gmail.comwrote:
>Apart from the initial installation of Python itself, I
never use an installer to install a Python package if I
can avoid it. I wouldn't trust it to install into the right
Python version.

On that: how would I go about updating the system Python, then? Or is
that going to be stuck at whatever it is, and Mac users are expected
to run two simultaneous Python installations? I'm not entirely
comfortable with having a separate MacPython (I used to do so, but it
caused so many issues with installing new packages that I gave up on
it) and would prefer to just update system Python.

- Avi
--
http://mail.python.org/mailman/listinfo/python-list
You will likely cause more problems updating the system python than
managing the two separate installations. OSX relies on the version of
python they ship. While there are likely cases where it could be
replaced completely safely the risks of having to re-install your OS
at some point because it has the wrong version of python are not worth
it.

--
Stand Fast,
tjg. [Timothy Grant]
Aug 3 '08 #3
You will likely cause more problems updating the system python than
managing the two separate installations.
That's sadly worrying.
OSX relies on the version of python they ship.
I think that helps my point--there *are* bug fixes between major
versions despite the new language changes, and that can really only be
a good thing.
While there are likely cases where it could be
replaced completely safely the risks of having to re-install your OS
at some point because it has the wrong version of python are not worth
it.

I haven't been a Mac user long enough to see a major version change (I
was on Linux/XP/Vista for most of 2.4 and switched distributions right
after 2.5 came out, and then XP before that), so I've never seen a
version change, but is this the sort of thing that will be upgraded in
Software Update?

- Avinash

Aug 3 '08 #4
On Sun, Aug 3, 2008 at 10:44 AM, Avinash Vora <av*********@gmail.comwrote:
>You will likely cause more problems updating the system python than
managing the two separate installations.

That's sadly worrying.
>OSX relies on the version of python they ship.

I think that helps my point--there *are* bug fixes between major versions
despite the new language changes, and that can really only be a good thing.
>While there are likely cases where it could be
replaced completely safely the risks of having to re-install your OS
at some point because it has the wrong version of python are not worth
it.


I haven't been a Mac user long enough to see a major version change (I was
on Linux/XP/Vista for most of 2.4 and switched distributions right after 2.5
came out, and then XP before that), so I've never seen a version change, but
is this the sort of thing that will be upgraded in Software Update?

- Avinash
I haven't paid enough attention to the system python in my four years
as an Apple user to know. I simply installed the python I wanted and
went from there.

I honestly don't think it is a cause for concern though. The situation
is very similar to on Linux (Red Hat has their version of python) you
simply install what you want and use it.

--
Stand Fast,
tjg. [Timothy Grant]
Aug 3 '08 #5
Avi wrote:
On that: how would I go about updating the system Python, then?
The usual advice is not to try to do that at all.
Generally it's best to treat anything in /System
as off-limits.
(I used to do so, but it
caused so many issues with installing new packages that I gave up on
it)
I've very rarely had any problem with maintaining my
own Python installation, but as I said, I always install
packages using "python setup.py".

Python itself copes very well with having multiple
versions installed, on all platforms, but you have to
do things the Python way.

--
Greg
Aug 4 '08 #6
(Greg: You only sent the email to me: you probably wanted to add the
mailing list to the recipients.)

On Aug 4, 2008, at 8:37 AM, greg wrote:
Avi wrote:
>On that: how would I go about updating the system Python, then?

The usual advice is not to try to do that at all.
Generally it's best to treat anything in /System
as off-limits.
Right, but I meant if there is an Apple-sanctioned way. I guess not?
>(I used to do so, but it
caused so many issues with installing new packages that I gave up on
it)

I've very rarely had any problem with maintaining my
own Python installation, but as I said, I always install
packages using "python setup.py".
I guess I'll give it a shot, then. Alias in bash to MacPython, I
assume?
Python itself copes very well with having multiple
versions installed, on all platforms, but you have to
do things the Python way.
My point was that it seems to be a bit of a hack.

Thanks for the advice from everyone, though.

--
Avi

Aug 4 '08 #7
Avinash Vora wrote:
(Greg: You only sent the email to me: you probably wanted to add the
mailing list to the recipients.)
I replied to the newsgroup as well, so it should
turn up in the list.
Right, but I meant if there is an Apple-sanctioned way. I guess not?
Not that I'm aware of.
I guess I'll give it a shot, then. Alias in bash to MacPython, I assume?
You'll probably find that the MacPython installer has set
things up so that simply running "python" in the shell
will get the version it has installed. Check the version
number displayed in the banner when you run it.

If it's not the right one, you could make a symlink
from /usr/bin/python to the one you want (by default it's
symlinked to the system python).

--
Greg
Aug 5 '08 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

33
by: Darren Dale | last post by:
I love the language. I love the community. My only complaint is that Python for Windows is built with Visual Studio. It is too difficult to build python, or a module, from source. This is what...
0
by: lmckaha | last post by:
Hi, Mysql version: 3.23.49 Solaris version: 2.7 gcc compiler version: 2.95.2 Python : 2.2.2 I'm evaluating the C and C++ API to decide which one to bye but I have many troubles.
22
by: Ted | last post by:
This page http://homepage.ntlworld.com/r.a.mccartney/test/utf-8_test_file_hacked_for_ie_with_local_dtd.xml doesn't work properly in Firefox or IE6. The faults are different. In Firefox the...
2
by: Tim N. van der Leeuw | last post by:
I tried to create a windows executable of a pygtk program. My first attempt worked, kinda, except that no themes were applied and no readable fonts were found by pango; so all letters where just...
8
by: bhochstetler | last post by:
I am needing to build python 2.5 on Windows XP x64 Windows Server 2003 sp1 Platform SDK and am not finding anything documented on the process to use. Has anyone had any success with this? If so has...
10
by: seyensubs | last post by:
I have the following implementations of quicksort and insertion sort: def qSort(List): if List == : return return qSort( if x< List]) + List + \ qSort( if x>=List]) def insertSort(List):...
18
by: Istvan Albert | last post by:
Hello all, I've been debugging the reason for a major slowdown in a piece of code ... and it turns out that it was the zip function. In the past the lists that were zipped were reasonably short,...
0
by: Cameron Simpson | last post by:
On 03Aug2008 23:14, Avinash Vora <avinashvora@gmail.comwrote: It shouldn't be. It is often useful to have multiple versions of stuff installed. Replacing the system stuff means playing in the...
3
YarrOfDoom
by: YarrOfDoom | last post by:
I've started out on python a couple of weeks ago, and today I came to "7. Input and Output" in the python docs tutorial. So I tried some of it myself, but it always ends with completely mashed up...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.