Can't find module cPickle using Python 3.5 and Anaconda

Tom Walker picture Tom Walker · Mar 30, 2018 · Viewed 48.4k times · Source

I am trying to use cPickle on a windows box, using Anaconda. I am using python 3.5. I am not using a virtualenv (though probably should be).

When I try to import cPickle I get "ImportError: No module named 'cPickle'"

Python 3.5.0 |Anaconda custom (64-bit)| (default, Dec  1 2015, 11:46:22) [MSC v.
1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import cPickle
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named 'cPickle'

My understanding is that cPickle comes built in with Python 3.5, so I can't understand why cPickle is not found. Any idea what has gone wrong/how I can clean things up/how to troubleshoot the issue.

Answer

user2357112 supports Monica picture user2357112 supports Monica · Mar 30, 2018

There is no cPickle in Python 3. Just import pickle. pickle will automatically use the C accelerator.