What seems to be the matter? path =
"C:\\eclipse\\w orkspace\\moin1 34\\docbook\\xs lt\\html\\db_co mpiled.dat" f = file(path) cPickle.load(f)
Traceback (most recent call last):
File "<interacti ve input>", line 1, in ?
ImportError: No module named on. f = file(path) pickle.load(f)
Traceback (most recent call last):
File "<interacti ve input>", line 1, in ?
File "C:\Python24\li b\pickle.py", line 1390, in load
return Unpickler(file) .load()
File "C:\Python24\li b\pickle.py", line 872, in load
dispatch[key](self)
File "C:\Python24\li b\pickle.py", line 1083, in load_inst
klass = self.find_class (module, name)
File "C:\Python24\li b\pickle.py", line 1138, in find_class
__import__(modu le)
ImportError: No module named on.
Thanks,
Henry 1 3585
fanbanlo wrote: What seems to be the matter?
>>> path = "C:\\eclipse\\w orkspace\\moin1 34\\docbook\\xs lt\\html\\db_co mpiled.dat" >>> f = file(path) >>> cPickle.load(f) Traceback (most recent call last): File "<interacti ve input>", line 1, in ? ImportError: No module named on. >>> f = file(path) >>> pickle.load(f)
Traceback (most recent call last): File "<interacti ve input>", line 1, in ? File "C:\Python24\li b\pickle.py", line 1390, in load return Unpickler(file) .load() File "C:\Python24\li b\pickle.py", line 872, in load dispatch[key](self) File "C:\Python24\li b\pickle.py", line 1083, in load_inst klass = self.find_class (module, name) File "C:\Python24\li b\pickle.py", line 1138, in find_class __import__(modu le) ImportError: No module named on. Thanks,
Henry
Got it, forgot to open file in binary mode. Thx This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Bram Stolk |
last post by:
Hello,
I am using python-2.2.2 on linux-ARM.
Python itself works OK.
However, importing pickle gives me *very* strange results:
The first 'import pickle' fails with "ImportError: No module named StringIO"
If I immediately do a second 'import pickle', it works????
|
by: Justin Straube |
last post by:
Hello,
Im trying to compile a script with py2exe. The pickle module is causing the
program to give an error.
Traceback (most recent call last):
File "SETIstat.pyw", line 330, in ?
File "SETIstat.pyw", line 84, in start_up
File "SETIstat.pyw", line 79, in config_load
File "pickle.pyc", line 1390, in load
|
by: Grant Edwards |
last post by:
I finally figured out why one of my apps sometimes fails under
Win32 when it always works fine under Linux: Under Win32, the
pickle module only works with a subset of floating point
values. In particular the if you try to dump/load an infinity
or nan value, the load operation chokes:
Under Linux:
$ python
|
by: Mike P. |
last post by:
Hi all,
I'm working on a simulation (can be considered a game) in Python where I
want to be able to dump the simulation state to a file and be able to load
it up later. I have used the standard Python pickle module and it works fine
pickling/unpickling from files.
However, I want to be able to use a third party tool like an XML editor (or
other custom tool) to setup the initial state of the simulation, so I have
been playing around...
|
by: Guy Lateur |
last post by:
Hi all,
I've been writing an application containing a lot of settings which can be
changed by the user. I'm using wx.Config to read/write these settings (to
the windows registry). This means I can only store strings, ints and floats.
However, it would be very convenient if I could also store more general
objects. It seems to work for wx.Colour, but not for wx.Font. It raises a
"TypeError: can't pickle PySwigObject objects".
| |
by: crystalattice |
last post by:
I'm creating an RPG for experience and practice. I've finished a
character creation module and I'm trying to figure out how to get the
file I/O to work.
I've read through the python newsgroup and it appears that shelve
probably isn't the best option for various reasons. This lead me to
try messing w/ pickle, but I can't figure out how to use it with
classes. I've found many examples of using pickle w/ non-OOP code but
nothing that...
|
by: Jeffrey Barish |
last post by:
I have a class derived from string that is used in a pickle. In the new
version of my program, I moved the module containing the definition of the
class. Now the unpickle fails because it doesn't find the module. I was
thinking that I could make the unpickle work by putting a copy of the
module in the original location and then redefine the class by sticking a
__setstate__ in the class thusly:
def __setstate__(self, state):...
|
by: fizilla |
last post by:
Hello all!
I have the following weird problem and since I am new to Python I somehow cannot figure out an elegant solution. The problem reduces to the following question:
How to pickle a collections.defaultdict object that has set the default_factory property?
For Example (from the IDLE console):
>>> words = collections.defaultdict(lambda: 1)
>>> f = file("temp","w")
|
by: est |
last post by:
>>import md5
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python25\lib\pickle.py", line 1366, in dumps
Pickler(file, protocol).dump(obj)
File "C:\Python25\lib\pickle.py", line 224, in dump
self.save(obj)
File "C:\Python25\lib\pickle.py", line 306, in save
rv = reduce(self.proto)
File "C:\Python25\lib\copy_reg.py", line 69, in _reduce_ex
|
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,...
|
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...
| |
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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...
|
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();...
|
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...
|
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: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |