[Pythonmac-SIG] 'import site' failed. Trouble starting python. What does this mean?

Louis Pecora pecora at anvil.nrl.navy.mil
Wed Jul 20 01:33:20 CEST 2005


Bob Ippolito wrote:

>On Jul 19, 2005, at 3:36 AM, Louis Pecora wrote:
>
>  
>
>>I've been having trouble running Python from BBEdit and the MacPython
>>IDE (neither works) so I tried to start from the terminal.  I get this
>>message:
>>
>>louispec% python -v
>># installing zipimport hook
>>import zipimport # builtin
>># installed zipimport hook
>>'import site' failed; traceback:
>>    
>>
>
>That's no good.  Have you been screwing with environment variables?   
>PYTHONPATH, etc.?
>  
>
Yeah, I know I have trouble.  I haven't messed with any variables.  The 
whole thing worked fine, then after a trip to a conference where I 
barely used the computer,  Python was dead.

Disk First Aid repaired some of the directory (I think that's what it 
does) involving some Python Frameworks, but then ground to a halt with a 
cryptic message that it couldn't fix whatever it is that broken. 

I have ordered DiskWarrior and will try that.  I suspect something is 
broken in the directory.  But then I'm not an expert, maybe it's 
something in Python.

>Did the files get deleted from /System/Library/Frameworks/ 
>Python.framework/Versions/2.3/lib/python2.3 ?  Or were the  
>permissions mangled?
>
Not that I know of, but down in the directory you mention just above I have the following files shown below (sorry for the long list).  I notice that no files with names beginning with a letter past 'p' are there.  I'm not sure what's supposed to be there, but this looks suspicious.  

Opinions?

Files in /System/Library ... lib/python2.3:

__future__.py
__future__.pyc
__future__.pyo
__phello__.foo.py
__phello__.foo.pyc
__phello__.foo.pyo
_strptime.py
_strptime.pyc
_strptime.pyo
aifc.py
aifc.pyc
aifc.pyo
anydbm.py
anydbm.pyc
anydbm.pyo
asynchat.py
asynchat.pyc
asynchat.pyo
asyncore.py
asyncore.pyc
asyncore.pyo
atexit.py
atexit.pyc
atexit.pyo
audiodev.py
audiodev.pyc
audiodev.pyo
base64.py
base64.pyc
base64.pyo
BaseHTTPServer.py
BaseHTTPServer.pyc
BaseHTTPServer.pyo
Bastion.py
Bastion.pyc
Bastion.pyo
bdb.py
bdb.pyc
bdb.pyo
binhex.py
binhex.pyc
binhex.pyo
bisect.py
bisect.pyc
bisect.pyo
bsddb
calendar.py
calendar.pyc
calendar.pyo
cgi.py
cgi.pyc
cgi.pyo
CGIHTTPServer.py
CGIHTTPServer.pyc
CGIHTTPServer.pyo
cgitb.py
cgitb.pyc
cgitb.pyo
chunk.py
chunk.pyc
chunk.pyo
cmd.py
cmd.pyc
cmd.pyo
code.py
code.pyc
code.pyo
codecs.py
codecs.pyc
codecs.pyo
codeop.py
codeop.pyc
codeop.pyo
colorsys.py
colorsys.pyc
colorsys.pyo
commands.py
commands.pyc
commands.pyo
compileall.py
compileall.pyc
compileall.pyo
compiler
config
ConfigParser.py
ConfigParser.pyc
ConfigParser.pyo
Cookie.py
Cookie.pyc
Cookie.pyo
copy_reg.py
copy_reg.pyc
copy_reg.pyo
copy.py
copy.pyc
copy.pyo
csv.py
csv.pyc
csv.pyo
curses
dbhash.py
dbhash.pyc
dbhash.pyo
difflib.py
difflib.pyc
difflib.pyo
dircache.py
dircache.pyc
dircache.pyo
dis.py
dis.pyc
dis.pyo
distutils
doctest.py
doctest.pyc
doctest.pyo
DocXMLRPCServer.py
DocXMLRPCServer.pyc
DocXMLRPCServer.pyo
dumbdbm.py
dumbdbm.pyc
dumbdbm.pyo
dummy_thread.py
dummy_thread.pyc
dummy_thread.pyo
dummy_threading.py
dummy_threading.pyc
dummy_threading.pyo
email
encodings
FCNTL.py
FCNTL.pyc
FCNTL.pyo
filecmp.py
filecmp.pyc
filecmp.pyo
fileinput.py
fileinput.pyc
fileinput.pyo
fnmatch.py
fnmatch.pyc
fnmatch.pyo
formatter.py
formatter.pyc
formatter.pyo
fpformat.py
fpformat.pyc
fpformat.pyo
ftplib.py
ftplib.pyc
ftplib.pyo
getopt.py
getopt.pyc
getopt.pyo
getpass.py
getpass.pyc
getpass.pyo
gettext.py
gettext.pyc
gettext.pyo
glob.py
glob.pyc
glob.pyo
gopherlib.py
gopherlib.pyc
gopherlib.pyo
gzip.py
gzip.pyc
gzip.pyo
heapq.py
heapq.pyc
heapq.pyo
hmac.py
hmac.pyc
hmac.pyo
hotshot
htmlentitydefs.py
htmlentitydefs.pyc
htmlentitydefs.pyo
htmllib.py
htmllib.pyc
htmllib.pyo
HTMLParser.py
HTMLParser.pyc
HTMLParser.pyo
httplib.py
httplib.pyc
httplib.pyo
idlelib
ihooks.py
ihooks.pyc
ihooks.pyo
imaplib.py
imaplib.pyc
imaplib.pyo
imghdr.py
imghdr.pyc
imghdr.pyo
imputil.py
imputil.pyc
imputil.pyo
inspect.py
inspect.pyc
inspect.pyo
keyword.py
keyword.pyc
keyword.pyo
lib-dynload
lib-old
lib-tk
LICENSE.txt
linecache.py
linecache.pyc
linecache.pyo
locale.py
locale.pyc
locale.pyo
logging
macpath.py
macpath.pyc
macpath.pyo
macurl2path.py
macurl2path.pyc
macurl2path.pyo
mailbox.py
mailbox.pyc
mailbox.pyo
mailcap.py
mailcap.pyc
mailcap.pyo
markupbase.py
markupbase.pyc
markupbase.pyo
mhlib.py
mhlib.pyc
mhlib.pyo
mimetools.py
mimetools.pyc
mimetools.pyo
mimetypes.py
mimetypes.pyc
mimetypes.pyo
MimeWriter.py
MimeWriter.pyc
MimeWriter.pyo
mimify.py
mimify.pyc
mimify.pyo
modulefinder.py
modulefinder.pyc
modulefinder.pyo
multifile.py
multifile.pyc
multifile.pyo
mutex.py
mutex.pyc
mutex.pyo
netrc.py
netrc.pyc
netrc.pyo
new.py
new.pyc
new.pyo
nntplib.py
nntplib.pyc
nntplib.pyo
ntpath.py
ntpath.pyc
ntpath.pyo
nturl2path.py
nturl2path.pyc
nturl2path.pyo
opcode.py
opcode.pyc
opcode.pyo
optparse.py
optparse.pyc
optparse.pyo
os.py
os.pyc
os.pyo
os2emxpath.py
os2emxpath.pyc
os2emxpath.pyo
pdb.doc
pdb.py
pdb.pyc
pdb.pyo
pickle.py
pickle.pyc
pickle.pyo
pickletools.py
pickletools.pyc
pickletools.pyo
pipes.py
pipes.pyc
pipes.pyo
pkgutil.py
pkgutil.pyc
pkgutil.pyo

Nothing beyond this.

-- 
Cheers,

Lou Pecora

Code 6362
Naval Research Lab
Washington, DC  20375
USA
Ph:  +202-767-6002
email:  pecora at anvil.nrl.navy.mil



More information about the Pythonmac-SIG mailing list