New submission from Robert <bobbyr...@gmail.com>:

I implemented a data-structure as an object in a script, let's call it 
objectScript.py. I'm using this data-structure in other scripts like so:

from objectScript import data-structure

Populating this data-structure requires quite a bit of time, so when I'm done 
with it, I like to pickle it. However, if I try to load it from the pickled 
file, I get the following error:

ImportError: No module named objectScript

However, if I replace my 'from objectScript import data-structure' statement 
with the actual data-structure class definition from the objectScript.py file 
when I am pickling the object but then revert to the import statement when I am 
unpickling the object, everything works fine.

----------
components: Library (Lib)
messages: 155651
nosy: rj3d
priority: normal
severity: normal
status: open
title: Importing script as module causes ImportError with pickle.load
type: behavior
versions: Python 2.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue14290>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to