>>> import theano
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Python/2.7/site-packages/theano/__init__.py", line 52, in <module>
from theano.gof import (
File "/Library/Python/2.7/site-packages/theano/gof/__init__.py", line 38, in <module>
from theano.gof.cc import \
File "/Library/Python/2.7/site-packages/theano/gof/cc.py", line 30, in <module>
from theano.gof import link
File "/Library/Python/2.7/site-packages/theano/gof/link.py", line 18, in <module>
from theano.gof.type import Type
File "/Library/Python/2.7/site-packages/theano/gof/type.py", line 17, in <module>
from theano.gof.op import CLinkerObject
File "/Library/Python/2.7/site-packages/theano/gof/op.py", line 25, in <module>
from theano.gof.cmodule import GCC_compiler
File "/Library/Python/2.7/site-packages/theano/gof/cmodule.py", line 8, in <module>
import six.moves.cPickle as pickle
ImportError: No module named cPickle
我非常确定 cPickle没有问题。它可能是其他依赖的问题吗?我今天早上升级了所有软件包,这样就可能发生版本冲突。尽管如此,在我切换到theano的前沿版本后,问题仍然存在。有人会帮我搞清楚吗?
PS:我的开发设备是Macbook Pro 13(2015年初);我的系统版本是OS X 10.10.5; python版本是2.7.10
===========================第二次编辑================== =================
似乎我的Mac上安装了最新版本的六个版本。
YiqundeMacBook-Pro:~ Leo$ pip show six
---
Metadata-Version: 2.0
Name: six
Version: 1.9.0
Summary: Python 2 and 3 compatibility utilities
Home-page: http://pypi.python.org/pypi/six/
Author: Benjamin Peterson
Author-email: benjamin@python.org
License: MIT
Location: /Library/Python/2.7/site-packages
Requires:
答案 0 :(得分:7)
我遇到了同样的问题并且升级六个已解决的问题:
sudo easy_install --upgrade six
答案 1 :(得分:2)
尽量避免不惜一切代价使用sudo
。打开python会话并运行
import six
print six.__version__
print six.__file__
版本可能不是最新版本(1.10.0),因此请在导入的路径中手动删除six.py和six.pyc文件,然后运行pip install six
。 Python现在应该导入最新版本的6,与Theano兼容:)