开发者

Python: no module named unittest. How can I fix this?

It seems strange that a module from the std Python lib to be missing. I'm probably doing something wrong, but I cannot figure out what exactly.

shift@bt:~/experiments/$ python test/test_creation.py 
'import site' failed; use -v for traceback
Traceback (most recent call last):
  File "test/test_creation.py", line 1, in <module>
    import unittest
ImportError: No module named unittest

Running with the -v switch shows this:

Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56) 
[GCC 4.4.3] on linux2
Type "help", "copyright", "cre开发者_如何转开发dits" or "license" for more information.
Traceback (most recent call last):
  File "test/test_creation.py", line 1, in <module>
    import unittest
ImportError: No module named unittest
# 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
# clear sys.flags
# clear sys.float_info
# restore sys.stdin
# restore sys.stdout
# restore sys.stderr
# cleanup __main__
# cleanup[1] zipimport
# cleanup[1] signal
# cleanup[1] exceptions
# cleanup[1] _warnings
# cleanup sys
# cleanup __builtin__
# cleanup ints: 3 unfreed ints
# cleanup floats

Where should I look to figure out what's wrong?


You have your python environment installed into /home/shift/experiments/lib ? see docs.python.org on PYTHONHOME

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜