I successfully installed theano, but when I try to import it, it shows the following message. I updated the package six to the latest version 1.1.0.
import theano
File "/home/ubuntu/.local/lib/python2.7/site-packages/theano/__init__.py", line 52, in <module>
from theano.gof import (
File "/home/ubuntu/.local/lib/python2.7/site-packages/theano/gof/__init__.py", line 38, in <module>
from theano.gof.cc import \
File "/home/ubuntu/.local/lib/python2.7/site-packages/theano/gof/cc.py", line 30, in <module>
from theano.gof import link
File "/home/ubuntu/.local/lib/python2.7/site-packages/theano/gof/link.py", line 18, in <module>
from theano.gof.type import Type
File "/home/ubuntu/.local/lib/python2.7/site-packages/theano/gof/type.py", line 17, in <module>
from theano.gof.op import CLinkerObject
File "/home/ubuntu/.local/lib/python2.7/site-packages/theano/gof/op.py", line 25, in <module>
from theano.gof.cmodule import GCC_compiler
File "/home/ubuntu/.local/lib/python2.7/site-packages/theano/gof/cmodule.py", line 8, in <module>
import six.moves.cPickle as pickle
ImportError: No module named cPickle
I tried "import six.moves.cPickle as pickle" with the same six version and
I don't have this problem.
I suppose you have multiple six version installed. Uninstall all of them
and reinstall it.
On Thu, Dec 3, 2015 at 11:31 PM, imoonkey [email protected] wrote:
I successfully installed theano, but when I try to import it, it shows
the following message. I updated the package six to the latest version
1.1.0.import theanoFile
"/home/ubuntu/.local/lib/python2.7/site-packages/theano/init.py", line
52, in
from theano.gof import (
File
"/home/ubuntu/.local/lib/python2.7/site-packages/theano/gof/init.py",
line 38, in
from theano.gof.cc import \
File
"/home/ubuntu/.local/lib/python2.7/site-packages/theano/gof/cc.py", line
30, in
from theano.gof import link
File
"/home/ubuntu/.local/lib/python2.7/site-packages/theano/gof/link.py", line
18, in
from theano.gof.type import Type
File
"/home/ubuntu/.local/lib/python2.7/site-packages/theano/gof/type.py", line
17, in
from theano.gof.op import CLinkerObject
File
"/home/ubuntu/.local/lib/python2.7/site-packages/theano/gof/op.py", line
25, in
from theano.gof.cmodule import GCC_compiler
File
"/home/ubuntu/.local/lib/python2.7/site-packages/theano/gof/cmodule.py",
line 8, in
import six.moves.cPickle as pickle
ImportError: No module named cPickle—
Reply to this email directly or view it on GitHub.
Thanks! There was some version mismatch. It is fixed now!
Hi, How did you resolve this? I'm getting the same error
import cPickle works fine but not import six.moves.cPickle
I guess it's conflicting with another six installed by default in /Library
I'm on Mac OS X early 2015
Try to uninstall all six package, then reinstall it.
Try to not mix different python installation.
On Tue, Dec 8, 2015 at 9:30 PM, apuljain [email protected] wrote:
Hi, How did you resolve this? I'm getting the same error
import cPickle works fine but not import six.moves.cPickleI guess it's conflicting with another six installed by default in /Library
I'm on Mac OS X early 2015
—
Reply to this email directly or view it on GitHub
https://github.com/Theano/Theano/issues/3739#issuecomment-163087108.
I installed the latest version of six (version 1.10.0) via PyPI, which replaces the syntax of import six.moves.cPickle as pickle with from six.moves import cPickle as pickle (Python 2.7.10; Mac OS X 10.10.5). The problem seems to persist.
Actually, this might have solved the problem:
sudo easy_install --upgrade six
this solution "sudo easy_install --upgrade six" works for me, this
If you have "pip" installed, it is better to use it instead of easy_install. So this get:
"sudo pip install -U six"
But your command also work frequently.
sudo easy_install --upgrade six . works
I both installed pip and easy_install. Failed to use pip to upgrade, however easy_install fixed the problem . No idea of this...
Strange. I don't recommand using easy_install, but to use pip anymore. If you find the explanation, I would like to know it.
while importing keras i am getting below errors . i m not able to fix it. i am using Mac Machine please guide me..
import keras
Using Theano backend.
Traceback (most recent call last):
File "", line 1, in
File "/Library/Python/2.7/site-packages/keras/init.py", line 2, in
from . import backend
File "/Library/Python/2.7/site-packages/keras/backend/init.py", line 61, in
from .theano_backend import *
File "/Library/Python/2.7/site-packages/keras/backend/theano_backend.py", line 1, in
import theano
File "/Library/Python/2.7/site-packages/theano/init.py", line 52, in
from theano.gof import (
File "/Library/Python/2.7/site-packages/theano/gof/init.py", line 38, in
from theano.gof.cc import \
File "/Library/Python/2.7/site-packages/theano/gof/cc.py", line 24, in
from theano.gof import graph
ImportError: cannot import name graph
Can you give us your present working directory ? It s possible that there is a clash of two modules' name.
its /users/nottiee
problem fixed.. thanks github
Sorry, I meant to ask the content of pwd. Could you please show us all the files there ?
could you tell me how to install openCV in mac Machine through terminal ,,,because by using pip installer i am getting error
i m getting error while installing opencv through terminal
ravirajs-MacBook-Air:~ nottiee$ pip install OpenCV
Collecting OpenCV
Could not find a version that satisfies the requirement OpenCV (from versions: )
No matching distribution found for OpenCV
ravirajs-MacBook-Air:~ nottiee$
this solution "sudo easy_install --upgrade six" works for me, too.

How can i correct it
@arpita8 use pip with sudo or use Anaconda environment.
thanks
Its cPickle and not cPickel. Please ask user related questions on StackOverflow or theano-users google group.
Hello , please i run this code :
exp_number = 13
model.summary()
from numpy.core import multiarray
import cPickle as pickle
losses = pickle.load( open('/home/ubuntu/nilmtk/nilmtk/neuralnilm/tmpdata/history_exp' + str(exp_number) + '.pickle' , 'rb'))
test_set = pickle.load( open('/home/ubuntu/nilmtk/nilmtk/neuralnilm/tmpdata/TestSet.pickle', 'rb'))
X_test = test_set['X_test']
Y_test = test_set["Y_test"]
and i get this issue :
ImportError Traceback (most recent call last)
in ()
5 exp_number = 15
6 with open('/home/ubuntu/nilmtk/nilmtk/neuralnilm/tmpdata/history_exp' + str(exp_number) + '.pickle' , 'rb') as f:
----> 7 losses = pickle.load(f)
8 # load the test set
9 with open('/home/ubuntu/nilmtk/nilmtk/neuralnilm/tmpdata/TestSet.pickle', 'rb') as v:
ImportError: No module named multiarray
can someone please help me
Most helpful comment
I both installed pip and easy_install. Failed to use pip to upgrade, however easy_install fixed the problem . No idea of this...