问题描述
我正在尝试使用Anaconda在Windows框上使用cPickle.我正在使用python 3.5.我没有使用virtualenv(虽然应该是).
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).
当我尝试导入cPickle时,出现"ImportError:没有名为'cPickle'的模块"
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'
我的理解是cPickle是Python 3.5内置的,所以我不明白为什么找不到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.
推荐答案
Python 3中没有cPickle
.只需导入pickle
. pickle
将自动使用C加速器.
There is no cPickle
in Python 3. Just import pickle
. pickle
will automatically use the C accelerator.
这篇关于使用Python 3.5和Anaconda找不到模块cPickle的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!