problem python

Peter Otten __peter__ at web.de
Wed Jun 6 09:29:18 EDT 2012


Tom King wrote:
[Please hit "reply-all" in your email client when you answer a post. That 
way it will appear on the mailing list and give more people a chance to 
answer]
>>> when i type python in my command line console i get an error message
>>>>>> 'import site' failed; use -v for traceback
>>> Python 2.4.3 (#1, May 5 2011, 18:44:23)
>>> [GCC 4.1.2 20080704 (Red Hat 4.1.2-50)] on linux2
>>> Type "help", "copyright", "credits" or "license" for more information.

>>> what is going on and how i can fix it
>>> thanks in andvance
>>>> Did you write a module site.py yourself? If so rename it and don't forget
>> to remove the corresponding site.pyc. If that doesn't help invoke python
>> with
>>>> $ python -S
>>>> and then import site explicitly in the interactive interpreter:
>>>> >>> import site
>>>> You should get a traceback. If you cut and paste it and show it to us we
>> might tell you more. 

> thank you Peter for your response i followed your instructions and 
> get this time 
>> python -S
> Python 2.4.3 (#1, May 5 2011, 18:44:23) 
> [GCC 4.1.2 20080704 (Red Hat 4.1.2-50)] on linux2
> >>> import site
> Traceback (most recent call last):
> File "<stdin>", line 1, in ?
> ImportError: No module named site
> >>> 

So the file seems to be missing indeed. Frankly, that's not what I expected, 
and I don't know how to proceed from here. Can you import other modules, e. 
g. 
>>> import dis

? What does
>>> import sys
>>> sys.path

show?


More information about the Python-list mailing list

AltStyle によって変換されたページ (->オリジナル) /