On 9 May, 2007, at 22:50, Nehemiah Dacres wrote:

Site packages is where the platform dependant libraries of Mac python reside. they should be in /Library/Python/site-packages/ and thats where platform specific libraries are installed. Python home im not sure of, PYTHONPATH is where the python interpreter lives, it is specific to the particular version of python so each version [ 2.3, 2.4, 2.5] can possibly print a different response when you put the following commands in your python interpreter:

All of this is not quite true. In general the site-packages directory is not in the /Library/Python tree, that's just for Apple's build of Python. You can have ~/Library/Python/2.5/site-packages for your own private additions to the library (separate from other users, the same mechanism also works for other versions of python).

The actual system-wide site-packages directory is hidden in the Python.framework (again, unless you're using Apple's build of Python).

PYTHONPATH is another way to add items to sys.path, the value of the environment variable is split on colons and all elements are added to the path. IMHO one shouldn't use this mechanism in general. Either install packages in one of the site-packages locations or make add code to your scripts to set up the right environment.

PYTHONHOME is the location where python is installed. You basicly never have to set this unless you have some very special needs, a normal python installation is not one of them.

None of this is relevant for the original problem though...


>> import sys
>> print sys.path

you shall get a list of paths, these are the paths to all the directories (folders) that the python interpreter will look in for libraries.


On 5/5/07, Chris Cioffi <[EMAIL PROTECTED]> wrote:
Hello all,

I'm trying to get started with Python 2.5 on my Mac and for various
reasons would like to use th Python from MacPorts.
[http://www.macports.org/]

I've installed Python 2.5 and when I start it up I get the following:

"""
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Python 2.5 (r25:51908, May  4 2007, 19:57:54)
[GCC 4.0.1 (Apple Computer, Inc. build 5363)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
"""

What happens when you temporarily remove .pydistutils.cfg? What is the value of sys.executable (import sys;print sys.executable)?

This looks like a broken installation. You may want to ask on the macports list about this. Another alternative is trying to reinstall (port uninstall python25; port install python25), as a bonus you'll get python 2.5.1 instead of 2.5 ;-)

As an aside: why do you want to use the MacPorts build of python instead of the python.org one? This is just curiousity on my part, AFAIK both the python.org build and the MacPorts one should work just fine.


The only change I have from the default system is I have
.pydistutils.cfg with the following:
"""
[install]
install_lib = ~/Library/Python/$py_version_short/site-packages
install_scripts = ~/Applications/bin
install_data = ~/Library/Python/$py_version_short/share
"""

Does anyone have any idea on what I should set $PYTHONPATHHOME to?  My
ports install is the default location, /opt/local.

You shouldn't have to set PYTHONHOME (sic) at all.

Ronald

Any help would be very much appreciated!

Chris
--
"A little government and a little luck are necessary in life, but only
a fool trusts either of them." -- P. J. O'Rourke
_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig



--

"lalalalala! it's not broken because I can use it"

http://linux.slashdot.org/comments.pl? sid=194281&threshold=1&commentsort=0&mode=thread&cid=15927703
_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig

Attachment: smime.p7s
Description: S/MIME cryptographic signature

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

Reply via email to