By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,427 Members | 1,379 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,427 IT Pros & Developers. It's quick & easy.

bad marshal data in site.py in fresh 2.5 install win

P: n/a
Hi,

I have installed python two days ago on a USB memory stick (I am on
the move and have no laptop.) I am on windows computers, mostly XP,
all the time.

Now, after pluging it in to a different computer, I get the following
message when I run pyhthon:
'import site' failed; use -v for traceback

python -v gives:
------------------------------------------------------------------------
G:\Python25>python -v
# installing zipimport hook
import zipimport # builtin
# installed zipimport hook
# G:\Python25\lib\site.pyc matches G:\Python25\lib\site.py
import site # precompiled from G:\Python25\lib\site.pyc
# G:\Python25\lib\os.pyc matches G:\Python25\lib\os.py
import os # precompiled from G:\Python25\lib\os.pyc
import nt # builtin
# G:\Python25\lib\ntpath.pyc matches G:\Python25\lib\ntpath.py
import ntpath # precompiled from G:\Python25\lib\ntpath.pyc
# G:\Python25\lib\stat.pyc matches G:\Python25\lib\stat.py
import stat # precompiled from G:\Python25\lib\stat.pyc
# G:\Python25\lib\UserDict.pyc matches G:\Python25\lib\UserDict.py
import UserDict # precompiled from G:\Python25\lib\UserDict.pyc
# G:\Python25\lib\copy_reg.pyc matches G:\Python25\lib\copy_reg.py
import copy_reg # precompiled from G:\Python25\lib\copy_reg.pyc
# G:\Python25\lib\types.pyc matches G:\Python25\lib\types.py
import types # precompiled from G:\Python25\lib\types.pyc
import _types # builtin
# zipimport: found 74 names in G:\Python25\lib\site-packages\setuptools-0.6c3-py
2.5.egg
# G:\Python25\lib\locale.pyc matches G:\Python25\lib\locale.py
import locale # precompiled from G:\Python25\lib\locale.pyc
import encodings # directory G:\Python25\lib\encodings
# G:\Python25\lib\encodings\__init__.pyc matches G:\Python25\lib\encodings\__ini
t__.py
import encodings # precompiled from G:\Python25\lib\encodings\__init__.pyc
# G:\Python25\lib\codecs.pyc matches G:\Python25\lib\codecs.py
import codecs # precompiled from G:\Python25\lib\codecs.pyc
import _codecs # builtin
# G:\Python25\lib\encodings\aliases.pyc matches G:\Python25\lib\encodings\aliase
s.py
'import site' failed; traceback:
Traceback (most recent call last):
File "G:\Python25\lib\site.py", line 415, in <module>
main()
File "G:\Python25\lib\site.py", line 406, in main
aliasmbcs()
File "G:\Python25\lib\site.py", line 356, in aliasmbcs
import locale, codecs
File "G:\Python25\lib\locale.py", line 14, in <module>
import sys, encodings, encodings.aliases
File "F:\Python25\lib\encodings\__init__.py", line 32, in <module>
ValueError: bad marshal data
# G:\Python25\lib\warnings.pyc matches G:\Python25\lib\warnings.py
import warnings # precompiled from G:\Python25\lib\warnings.pyc
# G:\Python25\lib\linecache.pyc matches G:\Python25\lib\linecache.py
import linecache # precompiled from G:\Python25\lib\linecache.pyc
Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] on win
32
Type "help", "copyright", "credits" or "license" for more information.
>>>
---------------------------------------------------------

What can I do about this?

Thanks,

TiNo
Dec 29 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
TiNo schrieb:
# G:\Python25\lib\encodings\aliases.pyc matches
[...]
File "F:\Python25\lib\encodings\__init__.py", line 32, in <module>

What can I do about this?
Where does F:\Python25 come from?

If you have set any PYTHON* environment variables (e.g. PYTHONPATH),
unset them.

Regards,
Martin
Dec 30 '06 #2

P: n/a
TiNo schrieb:
# G:\Python25\lib\encodings\aliases.pyc matches
[...]
File "F:\Python25\lib\encodings\__init__.py", line 32, in <module>

What can I do about this?
Where does F:\Python25 come from?

If you have set any PYTHON* environment variables (e.g. PYTHONPATH),
unset them.

Regards,
Martin
Dec 30 '06 #3

P: n/a
Good question...

I am now on a different computer, one that has never heard of Python,
so no env vars are set. Again, this gives (my memory stick is now
F:\):

------------------------------
F:\Python25>python -v
# installing zipimport hook
import zipimport # builtin
# installed zipimport hook
# F:\Python25\lib\site.pyc matches F:\Python25\lib\site.py
import site # precompiled from F:\Python25\lib\site.pyc
# F:\Python25\lib\os.pyc matches F:\Python25\lib\os.py
import os # precompiled from F:\Python25\lib\os.pyc
import nt # builtin
# F:\Python25\lib\ntpath.pyc matches F:\Python25\lib\ntpath.py
import ntpath # precompiled from F:\Python25\lib\ntpath.pyc
# F:\Python25\lib\stat.pyc matches F:\Python25\lib\stat.py
import stat # precompiled from F:\Python25\lib\stat.pyc
# F:\Python25\lib\UserDict.pyc matches F:\Python25\lib\UserDict.py
import UserDict # precompiled from F:\Python25\lib\UserDict.pyc
# F:\Python25\lib\copy_reg.pyc matches F:\Python25\lib\copy_reg.py
import copy_reg # precompiled from F:\Python25\lib\copy_reg.pyc
# F:\Python25\lib\types.pyc matches F:\Python25\lib\types.py
import types # precompiled from F:\Python25\lib\types.pyc
import _types # builtin
# zipimport: found 74 names in F:\Python25\lib\site-packages\setuptools-0.6c3-py
2.5.egg
# F:\Python25\lib\locale.pyc matches F:\Python25\lib\locale.py
import locale # precompiled from F:\Python25\lib\locale.pyc
import encodings # directory F:\Python25\lib\encodings
# F:\Python25\lib\encodings\__init__.pyc matches F:\Python25\lib\encodings\__ini
t__.py
import encodings # precompiled from F:\Python25\lib\encodings\__init__.pyc
# F:\Python25\lib\codecs.pyc matches F:\Python25\lib\codecs.py
import codecs # precompiled from F:\Python25\lib\codecs.pyc
import _codecs # builtin
# F:\Python25\lib\encodings\aliases.pyc matches F:\Python25\lib\encodings\aliase
s.py
'import site' failed; traceback:
Traceback (most recent call last):
File "F:\Python25\lib\site.py", line 415, in <module>
main()
File "F:\Python25\lib\site.py", line 406, in main
aliasmbcs()
File "F:\Python25\lib\site.py", line 356, in aliasmbcs
import locale, codecs
File "F:\Python25\lib\locale.py", line 14, in <module>
import sys, encodings, encodings.aliases
File "F:\Python25\lib\encodings\__init__.py", line 32, in <module>
from encodings import aliases
ValueError: bad marshal data
# F:\Python25\lib\warnings.pyc matches F:\Python25\lib\warnings.py
import warnings # precompiled from F:\Python25\lib\warnings.pyc
# F:\Python25\lib\linecache.pyc matches F:\Python25\lib\linecache.py
import linecache # precompiled from F:\Python25\lib\linecache.pyc
Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] on win
32
Type "help", "copyright", "credits" or "license" for more information.
>>>
-------------------------------------------------------

??

also removed site.pyc, and run it again, but with the same result.
2006/12/29, "Martin v. Lwis" <ma****@v.loewis.de>:
TiNo schrieb:
# G:\Python25\lib\encodings\aliases.pyc matches
[...]
File "F:\Python25\lib\encodings\__init__.py", line 32, in <module>

What can I do about this?

Where does F:\Python25 come from?

If you have set any PYTHON* environment variables (e.g. PYTHONPATH),
unset them.

Regards,
Martin
Dec 30 '06 #4

P: n/a
TiNo schrieb:
File "F:\Python25\lib\encodings\__init__.py", line 32, in <module>
from encodings import aliases
ValueError: bad marshal data

also removed site.pyc, and run it again, but with the same result.
It's likely rather aliases.pyc which is bad, so try removing that.
If in doubt, remove all .pyc files.

If one of them is bad, it's either because the stick wasn't ejected
properly at some point, or it suffers from data loss.

Regards,
Martin
Jan 3 '07 #5

P: n/a
Removing aliases.pyc solved it.

Thank you.

2007/1/3, "Martin v. Lwis" <ma****@v.loewis.de>:
TiNo schrieb:
File "F:\Python25\lib\encodings\__init__.py", line 32, in <module>
from encodings import aliases
ValueError: bad marshal data

also removed site.pyc, and run it again, but with the same result.

It's likely rather aliases.pyc which is bad, so try removing that.
If in doubt, remove all .pyc files.

If one of them is bad, it's either because the stick wasn't ejected
properly at some point, or it suffers from data loss.

Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
Jan 3 '07 #6

This discussion thread is closed

Replies have been disabled for this discussion.