473,779 Members | 1,913 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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>pyt hon -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\setupt ools-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\__in it__.pyc matches G:\Python25\lib \encodings\__in i
t__.py
import encodings # precompiled from G:\Python25\lib \encodings\__in it__.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\alia ses.pyc matches G:\Python25\lib \encodings\alia se
s.py
'import site' failed; traceback:
Traceback (most recent call last):
File "G:\Python25\li b\site.py", line 415, in <module>
main()
File "G:\Python25\li b\site.py", line 406, in main
aliasmbcs()
File "G:\Python25\li b\site.py", line 356, in aliasmbcs
import locale, codecs
File "G:\Python25\li b\locale.py", line 14, in <module>
import sys, encodings, encodings.alias es
File "F:\Python25\li b\encodings\__i nit__.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
5 5244
TiNo schrieb:
# G:\Python25\lib \encodings\alia ses.pyc matches
[...]
File "F:\Python25\li b\encodings\__i nit__.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
TiNo schrieb:
# G:\Python25\lib \encodings\alia ses.pyc matches
[...]
File "F:\Python25\li b\encodings\__i nit__.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
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>pyt hon -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\setupt ools-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\__in it__.pyc matches F:\Python25\lib \encodings\__in i
t__.py
import encodings # precompiled from F:\Python25\lib \encodings\__in it__.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\alia ses.pyc matches F:\Python25\lib \encodings\alia se
s.py
'import site' failed; traceback:
Traceback (most recent call last):
File "F:\Python25\li b\site.py", line 415, in <module>
main()
File "F:\Python25\li b\site.py", line 406, in main
aliasmbcs()
File "F:\Python25\li b\site.py", line 356, in aliasmbcs
import locale, codecs
File "F:\Python25\li b\locale.py", line 14, in <module>
import sys, encodings, encodings.alias es
File "F:\Python25\li b\encodings\__i nit__.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. Löwis" <ma****@v.loewi s.de>:
TiNo schrieb:
# G:\Python25\lib \encodings\alia ses.pyc matches
[...]
File "F:\Python25\li b\encodings\__i nit__.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
TiNo schrieb:
File "F:\Python25\li b\encodings\__i nit__.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
Removing aliases.pyc solved it.

Thank you.

2007/1/3, "Martin v. Löwis" <ma****@v.loewi s.de>:
TiNo schrieb:
File "F:\Python25\li b\encodings\__i nit__.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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2433
by: syd | last post by:
Hello all, In my project, I have container classes holding lists of item classes. For example, a container class myLibrary might hold a list of item classes myNation and associated variables like myNation.name='USA' and myNation.continent='North America'. Bottom line, I was hoping to use this structure to marshal the classes to xml.
2
1473
by: Larry Brindise | last post by:
I have deployed an ASP.NET application successfully on Windows 2000 and 2003. When I deploy it on an XP Pro machine (fresh install with framework 1.1 and IIS installed), I get a very unexpected result. Keep in mind I install everything as "default" as it gets, IIS included. I install my project into a virtual directory, so I browse to my installed site as: http://localhost/myproject Yes, there is a file called "default.aspx" in my...
4
6871
by: Michael McGarry | last post by:
Hi, I am using the marshal module in python to save a data structure to a file. It does not appear to be portable. The data is saved on a Linux machine. Loading that same data on a Mac gives me the bad marshal data message. Is this data really not portable or I am doing something wrong here. I thought the whole point of using Python and similar cross platform scripting languages to write once run everywhere, does that not hold
4
20407
by: Hafner Avi | last post by:
Hi, I am trying to find out what is the difference between Web-Site and Web-Application-Project in Visual Studio 2005 ? People – what do you recommend ?
1
1557
by: Handle | last post by:
I want to customize some aspx / ascx files of a precompiled site (the project portofolio web access site). I have no access to source code. Using Visual Studio, when I try to edit one these files in "design view", I get the following two categories of errors: 1) Some "Cannot switch views" errors, like the following: "Cannot switch views: This end tag has no matching start tag." "Cannot switch views: Validation (XHTML 1.0...
7
2627
by: Arthur | last post by:
hi, this might be a simple one to them who know: i'm developing an asp.net project and use the debug mode. i have a xml file which contains data, that shall be read, if a specific page is run. when i build the project the file is correctly copied to the build location (i selected "build action: none" and "copy if newer"). but when the project is run, the xml file is missing at the directory from which the site is executed. it does not...
2
7207
by: O.B. | last post by:
When using Marshal to copy data from a byte array to the structure below, only the first byte of the "other" array is getting copied from the original byte array. What do I need to specify to get Marshal.PtrToStructure to copy the all the data into the "other" array? unsafe public struct DeadReckoning {
0
2135
by: Charming12 | last post by:
Hi All, I have a strange problem and due to my inefficiency with IntPtr i am unable to figure it out. I have an structure something like: public struct Detail { public int age; public Detail(int _age)
2
15944
by: O.B. | last post by:
I have operation within a class that marshals the data into a byte array. Below are three different ways that work. Are there any downsides to using one over the the other? public virtual byte ToRaw1() { byte byteArray = new byte; IntPtr pointer = Marshal.AllocHGlobal(Size); Marshal.StructureToPtr(this, pointer, false); Marshal.Copy(pointer, byteArray, 0, Size);
0
9636
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9474
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10306
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10138
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7485
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6724
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5373
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5503
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4037
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.