[Pythonmac-SIG] Fwd: I may have wrecked my python

Kent Quirk kquirk at solidworks.com
Sun Feb 26 20:43:28 CET 2006


Yes, your message arrived. Several times. :-)

I'm guessing you've probably started stuffing things into directories
where you shouldn't be messing around.

In general, on OS X, if it starts with /System or /usr, leave it alone,
except for /usr/local. In particular, don't go messing with the system
install of Python 2.3.

The general way of adding stuff so that Python can find it is to add it
to PYTHONPATH (not PATH). Don't go deleting modules or moving them
around; anything that comes in the Python framework should be left the
heck alone.

If you've been mucking around in the system Python frameworks, you may
have borked it. It may be safest just to reinstall OS X. 

Next time, when you get import failures, try adding to PYTHONPATH.

	Kent


-----Original Message-----
From: pythonmac-sig-bounces at python.org
[mailto:pythonmac-sig-bounces at python.org] On Behalf Of Nehemiah Dacres
Sent: Friday, February 24, 2006 10:32 PM
To: pythonmac-sig at python.org
Subject: [Pythonmac-SIG] Fwd: I may have wrecked my python

From: Nehemiah I. Dacres <vivacarlie at gmail.com>
Date: Feb 23, 2006 11:40 PM
Subject: I may have wrecked my python
To: pythonmac-sig at python.org


I am a student of Computer Science and i need help understanding how
MacOSX handles Python.
the class I am in is "Intro to Object Oriented Programing" so they
teach in python to reduce teaching of syntax so they can focus on O.
Orientation. I need to import modules we create in class into my
programs and i want to be able to do this as painlessly as possible
per run. My first solution was to find where all the other third party
modules are kept so i found "PyObjC" and there  i found how to install
the modules i needed for class. I got this to work and the terminal
agreed however lately I've been having problems.
       every sence then, ive been getting this error

'import site' failed; use -v for traceback
'import site' failed; use -v for traceback
'import site' failed; use -v for traceback
Could not find platform independent libraries <prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
'import site' failed; use -v for traceback

and I really don't know what's going on. I know what PATH is and how
to append it but my knowledge of unix stops at your tutorials in the
tiger terminal, and that of Inside Mac (I never even got Fink and
those X Droplets to work ) so I don't want to mess things up further
than I already have. Recently (im certian it was a later date than
when i changed that) Bittorrent stopped working. I ran it from withing
the package and got this

Last login: Thu Feb 16 20:52:55 on ttyp2
/Users/Nehemiah/Applications/BitTorrent.app/Contents/MacOS/BitTorrent;
exit
Welcome to Darwin!
adsl-70-130-208-110:~ Nehemiah$
/Users/Nehemiah/Applications/BitTorrent.app/Contents/MacOS/BitTorrent;
exit
Could not find platform independent libraries <prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
'import site' failed; use -v for traceback
Traceback (most recent call last):
 File
"/Users/Nehemiah/Applications/BitTorrent.app/Contents/Resources/__main__
.py",
line 1, in ?
   import AppHelper
 File "./AppHelper.py", line 14, in ?
 File "./AppKit/__init__.py", line 8, in ?
 File "./AppKit/_AppKitSignatures.py", line 1, in ?
 File "./objc/__init__.py", line 20, in ?
 File "./objc/_convenience.py", line 21, in ?
ImportError: No module named itertools
2006-02-16 21:02:44.085 BitTorrent[388] *** Uncaught exception:
<NSInternalInconsistencyException>
/Users/drue/wa/osx/main-embedded-interpreter.m:75 pyobjc_main()
PyRun_SimpleFile failed with file
'/Users/Nehemiah/Applications/BitTorrent.app/Contents/Resources/__main__
.py'.
 See console for errors.
Trace/BPT trap
logout
[Process completed]

Most of that was greek to me but upon looking at the explanation the
problem was clearly my python. (which was made even more obvious when
looking at the resources folder: it seems Bittorent is a Python native
app). This makes things even more dire because I've been using that
program for my anime fix, it doesn't work for ANY account on the
machine.
the final change is that i found the location of the path in
Extras.pth
(/System/Library/Frameworks/Python.framework/Versions/2.3/Extras/lib/pyt
hon2.3)
found that the last folder was just "python" instead of "python2.3"
but after I remedied that, it still didn't work
the situation is pretty bad but at least regular scripts work
(
n=raw_input('enter the number up to which you want to take the product')
n=int(n)
k=raw_input('enter the number u want to skip')
k=int(k)

prod=1
for i in range (1,n+1,k):
       prod*=i
       print i
       print prod
)
once with TextWrangler The terminal told me that it couldn't find the
debugger file. i just found the file dbg.py and put it were the
terminal said it was looking, and sence then i haven't gotten that
message.

Thank you, for your help
_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG at python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


More information about the Pythonmac-SIG mailing list