Originally reported by: Yiqun Liu (Bitbucket: yiqun_liu, GitHub: Unknown)
Yesterday, I updated all the packages via pip and theano couldn't be imported due to following error:
#!Terminal
>>> 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
</module></module></module></module></module></module></module></module></stdin>
It seems that the problem comes from six - Yet I've tried importing cPickle itself in python and it didn't fail. Moreover, the issue still existed even after I updated Theano to the bleeding edge version. And my terminal returned these words when I typed 'pip show six':
#!Terminal
---
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.org
License: MIT
Location: /Library/Python/2.7/site-packages
Requires:
Evidently, I've six installed on my computer. Therefore, I can make sure that the problem is due to a bug of six. Please fix the issue, thanks.
- Bitbucket: https://bitbucket.org/gutworth/six/issue/132
该提问来源于开源项目:benjaminp/six