ModuleNotFoundError:Python 3.7.3上没有名为“cPickle”的模块

2024-10-01 15:34:09 发布

您现在位置:Python中文网/ 问答频道 /正文

将cPickle作为pkl导入 回溯(最近一次呼叫): 文件“预处理_维基.py“,第13行,英寸 作为CPIL导入 ModuleNotFoundError:没有名为“cPickle”的模块


Tags: 模块文件pypklcpickle英寸modulenotfounderrorcpil
1条回答
网友
1楼 · 发布于 2024-10-01 15:34:09

A common pattern in Python 2.x is to have one version of a module implemented in pure Python, with an optional accelerated version implemented as a C extension; for example, pickle and cPickle. This places the burden of importing the accelerated version and falling back on the pure Python version on each user of these modules. In Python 3.0, the accelerated versions are considered implementation details of the pure Python versions. Users should always import the standard version, which attempts to import the accelerated version and falls back to the pure Python version. The pickle / cPickle pair received this treatment.

所以只要使用import pickle 对于python 3

Source

相关问题 更多 >

    热门问题