Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > The case of the missing modules

Reply
Thread Tools

The case of the missing modules

 
 
Dan Bishop
Guest
Posts: n/a
 
      07-26-2003
I installed Python on the HP 3000 at work today.

The interpreter itself appears to be working fine, but "import math",
"import datetime", etc. fail with "ImportError: No module named
[name]". (However, os and system can be imported successfully.)

I used help('modules') to print a list of available modules and there
were only 14 (__builtin__, _codecs, _sre, _symtable, errno,
exceptions, gc, imp, marshal,
posix, signal, sys, xxsubtype, zipimport).

Any ideas as to why Python can't find most of its modules?

-------------------------------------------------------------------------------

$ ./python -v
# installing zipimport hook
import zipimport # builtin
# installed zipimport hook
# /tmp/python/Lib/site.pyc matches /tmp/python/Lib/site.py
import site # precompiled from /tmp/python/Lib/site.pyc
# /tmp/python/Lib/os.pyc matches /tmp/python/Lib/os.py
import os # precompiled from /tmp/python/Lib/os.pyc
import posix # builtin
# /tmp/python/Lib/posixpath.pyc matches /tmp/python/Lib/posixpath.py
import posixpath # precompiled from /tmp/python/Lib/posixpath.pyc
# /tmp/python/Lib/stat.pyc matches /tmp/python/Lib/stat.py
import stat # precompiled from /tmp/python/Lib/stat.pyc
# /tmp/python/Lib/copy_reg.pyc matches /tmp/python/Lib/copy_reg.py
import copy_reg # precompiled from /tmp/python/Lib/copy_reg.pyc
# /tmp/python/Lib/types.pyc matches /tmp/python/Lib/types.py
import types # precompiled from /tmp/python/Lib/types.pyc
# /tmp/python/Lib/warnings.pyc matches /tmp/python/Lib/warnings.py
import warnings # precompiled from /tmp/python/Lib/warnings.pyc
# /tmp/python/Lib/linecache.pyc matches /tmp/python/Lib/linecache.py
import linecache # precompiled from /tmp/python/Lib/linecache.pyc
Python 2.3c1 (#9, Aug 13 1970, 13:25:05)
[GCC 3.2.2] on mpeix70
Type "help", "copyright", "credits" or "license" for more information.
>>> raise SystemExit

# clear __builtin__._
# clear sys.path
# clear sys.argv
# clear sys.ps1
# clear sys.ps2
# clear sys.exitfunc
# clear sys.exc_type
# clear sys.exc_value
# clear sys.exc_traceback
# clear sys.last_type
# clear sys.last_value
# clear sys.last_traceback
# clear sys.path_hooks
# clear sys.path_importer_cache
# clear sys.meta_path
# restore sys.stdin
# restore sys.stdout
# restore sys.stderr
# cleanup __main__
# cleanup[1] zipimport
# cleanup[1] warnings
# cleanup[1] signal
# cleanup[1] site
# cleanup[1] linecache
# cleanup[1] posix
# cleanup[1] types
# cleanup[1] exceptions
# cleanup[2] stat
# cleanup[2] copy_reg
# cleanup[2] posixpath
# cleanup[2] os
# cleanup[2] os.path
# cleanup sys
# cleanup __builtin__
# cleanup ints: 4 unfreed ints in 4 out of 105 blocks
# cleanup floats
$ set | grep "PYTHON"
PYTHONHOME="/tmp/python"
PYTHONPATH="/tmp/python/Lib"
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Importing v reloading modules modules Peter Peyman Puk Python 0 03-19-2010 05:09 PM
Disabling modules using Modules/Setup Ben Weintraub Python 0 09-09-2006 12:04 AM
Importing modules from within other modules Tobiah Python 2 09-14-2003 09:18 PM
imputils - import problem modules from sys.modules Remy Cool Python 1 08-27-2003 02:25 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57