2

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
Community
  • 1
  • 1
dimpol
  • 545
  • 9
  • 21
  • Do you use a virtualenv? If so, might wanna install nose-parameterized in there. Is there a requirements.txt somewhere? – randyr Jan 16 '17 at 15:44
  • As far as I know I don't use a virtualenv, how would I check? Searching through home also didn't turn up any `requirements.txt` related to either nose, nose-parameterized or theano – dimpol Jan 16 '17 at 15:47
  • If you don't know if you're using virtualenv; you're not using virtualenv. You should probably read up on it though. It allows you to create "isolated" python working enviroments with its own modules. Other than that, I haven't a clue, never used Theano. – randyr Jan 16 '17 at 15:48
  • Thanks for the tip, then I'll leave this open hoping someone else has experience with this error – dimpol Jan 16 '17 at 16:08
  • how did you install theano? – malioboro Jan 17 '17 at 07:34
  • I added this information in an edit, this should make the error reproducible. – dimpol Jan 17 '17 at 09:14

2 Answers2

4

Found the problem, anaconda was looking in its own folder. So to solve, I did:
conda install nose-parameterized

dimpol
  • 545
  • 9
  • 21
1

The following works for me:

pip install nose-parameterized

IPhysResearch
  • 119
  • 1
  • 4