Ubuntu 16.04 LTS,试图用pip安装cpickle.我搜索了一下,还没找到任何有用的东西.
PYTHONPATH未设定.
错误信息
user@hostname:~$sudo -H pip3 install cpickleCollecting cpickle Using cached cpickle-0.5.tar.gz Complete output from command python setup.py egg_info: Traceback (most recent call last): file "
故障排除步骤
# version infouser@hostname:~$python --versionPython 2.7.12user@hostname:~$python3 --versionPython 3.5.2# I don't think cache is the problemrm -rf ~/.cache/sudo -H pip install cpickle --no-cache-dir # same problemsudo -H pip3 install cpickle --no-cache-dir # same problem
最佳答案检查互联网,我发现了这个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. The profile module is on the List for 3.1. The StringIO module has been turned into a class in the io module.
这意味着在python3中它作为一个库…
import _pickle as cPickle
总结 以上是内存溢出为你收集整理的python – pip install pickle not working – 没有这样的文件或目录全部内容,希望文章能够帮你解决python – pip install pickle not working – 没有这样的文件或目录所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)