ImportError: Import by filename is not supported when unpickleing

Jason Benjamin hexusnexus at gmail.com
Wed Jul 27 17:54:16 EDT 2016


On Wed, 27 Jul 2016 17:25:43 -0400, Larry Martell wrote:

> When I try and unpickle an object with pickle.loads it fails with:
> 
> ImportError: Import by filename is not supported when unpickleing
> 
> I've never used pickle before. Why do I get this and how can I fix it?

Try using *pickle.load* instead of *pickle.loads*.  pickle.loads is for 
strings.  Retrieved from documentation: help(pickle) after importing 
pickle. 



-- 
[The Computer] was the first machine man built that assisted the power of 
his brain instead of the strength of his arm. - Grace Hopper



More information about the Python-list mailing list