At the moment I am trying to install theano on my ubuntu 16.04 system with cuda support. The installation process itself went well until I tried to test the installation:
python -c "import theano; theano.test()"
The last few lines of the output were:
======================================================================
ERROR: Failure: ImportError (No module named nose_parameterized)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/myUser/anaconda2/lib/python2.7/site-packages/nose/loader.py", line 418, in loadTestsFromName
addr.filename, addr.module)
File "/home/myUser/anaconda2/lib/python2.7/site-packages/nose/importer.py", line 47, in importFromPath
return self.importFromDir(dir_path, fqname)
File "/home/myUser/anaconda2/lib/python2.7/site-packages/nose/importer.py", line 94, in importFromDir
mod = load_module(part_fqname, fh, filename, desc)
File "/home/myUser/anaconda2/lib/python2.7/site-packages/theano/tests/test_rop.py", line 16, in <module>
from theano.tests import unittest_tools as utt
File "/home/myUser/anaconda2/lib/python2.7/site-packages/theano/tests/unittest_tools.py", line 7, in <module>
from nose_parameterized import parameterized
ImportError: No module named nose_parameterized
----------------------------------------------------------------------
Ran 408 tests in 13.085s
FAILED (SKIP=26, errors=80)
These were preceded by approximately 20 blocks with what appears to be different tests failing on exactly the same top 3 lines in the stacktrace. The code where the final occurs looks like this (with added line numbers):
411. # FIXME: to support module.name names,
412. # do what resolve-name does and keep trying to
413. # import, popping tail of module into addr.call,
414. # until we either get an import or run out of
415. # module parts
416. try:
417. module = self.importer.importFromPath(
418. addr.filename, addr.module)
419. finally:
420. self.config.plugins.afterImport(
421. addr.filename, addr.module)
While searching for a solution I came across:
Error running nosetests
I tried the solution proposed there:
sudo pip install nose-parameterized
However this had no effect. Does anyone know what else could be causing this error?
edit: so I reinstalled theano to make the problem more reproducible. I installed theano using the instructions found here, so I used:
sudo apt-get install python-numpy python-scipy python-dev python-pip python-nose g++ libopenblas-dev git
sudo pip install Theano
Then I used:
nosetests theano
The last few lines of the output of this are almost the same as earlier:
======================================================================
ERROR: Failure: ImportError (No module named nose_parameterized)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/myUser/anaconda2/lib/python2.7/site-packages/nose/loader.py", line 418, in loadTestsFromName
addr.filename, addr.module)
File "/home/myUser/anaconda2/lib/python2.7/site-packages/nose/importer.py", line 47, in importFromPath
return self.importFromDir(dir_path, fqname)
File "/home/myUser/anaconda2/lib/python2.7/site-packages/nose/importer.py", line 94, in importFromDir
mod = load_module(part_fqname, fh, filename, desc)
File "/home/myUser/.local/lib/python2.7/site-packages/theano/tests/test_rop.py", line 16, in <module>
from theano.tests import unittest_tools as utt
File "/home/myUser/.local/lib/python2.7/site-packages/theano/tests/unittest_tools.py", line 7, in <module>
from nose_parameterized import parameterized
ImportError: No module named nose_parameterized
----------------------------------------------------------------------
Ran 457 tests in 160.608s
FAILED (SKIP=24, errors=95)
edit 2: I thought it might be a python-version issue. When I try:
python -V
I get:
Python 2.7.12 :: Anaconda 4.2.0 (64-bit)
And the following folders exist:
/usr/local/lib/python2.7/dist-packages/nose_parameterized
So, that shouldn't be a problem as far as I can see. However when I try:
python2.7 -c "import nose_parameterized"
I get:
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named nose_parameterized
Found the problem, anaconda was looking in its own folder. So to solve, I did:
conda install nose-parameterized