Re: pickle, modules, and ImportErrors

2015-01-07 Thread Chris Angelico
On Thu, Jan 8, 2015 at 11:23 AM, John Ladasky wrote: >> P.S. don't use pickle, it is a security vulnerability equivalent in >> severity to using exec in your code, and an unversioned opaque >> schemaless blob that is very difficult to work with when circumstances >> change. > > For all of its shor

Re: pickle, modules, and ImportErrors

2015-01-07 Thread John Ladasky
On Wednesday, January 7, 2015 12:56:29 PM UTC-8, Devin Jeanpierre wrote: [snip] > If you never run model directly, and only ever import it or run it as > my_svr.model, then you will be fine, and pickles will all serialize > and deserialize the same way. Thank you Devin... I re-ran TrainingSessio

Re: pickle, modules, and ImportErrors

2015-01-07 Thread Ian Kelly
On Wed, Jan 7, 2015 at 1:12 PM, John Ladasky wrote: > Do I need to "import my_svr.model as model" then? Adding that line changes > nothing. I get the exact same "ImportError: No module named 'model'". > > Likewise for "import my_svr", "from my_svr import *", or even "from > my_svr.model import

Re: pickle, modules, and ImportErrors

2015-01-07 Thread Devin Jeanpierre
On Wed, Jan 7, 2015 at 2:12 PM, John Ladasky wrote: > If I execute "import my_svr" in an iPython interpreter, everything works as I > think that I should expect: -snip- > However, a nearly-identical program in the parent folder fails (note that all > I change is the relative path to the file): >