目前我正在尝试使用cuda支持在我的ubuntu 16.04系统上安装theano。在我尝试测试安装之前,安装过程本身进展顺利:
======================================================================
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)
输出的最后几行是:
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)
这些前面有大约20个块,看起来不同的测试在堆栈跟踪中完全相同的前3行失败。最终发生的代码如下所示(添加了行号):
sudo pip install nose-parameterized
在寻找解决方案时,我遇到了:
concat
我尝试了那里提出的解决方案:
sudo apt-get install python-numpy python-scipy python-dev python-pip python-nose g++ libopenblas-dev git
sudo pip install Theano
但这没有效果。有谁知道还有什么可能导致这个错误?
编辑:所以我重新安装了theano,使问题更具可重复性。我使用Error running nosetests找到的说明安装了theano,所以我使用了:
nosetests theano
然后我用了:
======================================================================
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)
此输出的最后几行几乎与之前相同:
python -V
编辑2:我认为这可能是一个python版本的问题。当我尝试:
Python 2.7.12 :: Anaconda 4.2.0 (64-bit)
我明白了:
/usr/local/lib/python2.7/dist-packages/nose_parameterized
存在以下文件夹:
python2.7 -c "import nose_parameterized"
所以,就我所见,这不应该是一个问题。但是,当我尝试:
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named nose_parameterized
我明白了:
{{1}}
答案 0 :(得分:4)
发现问题,anaconda正在寻找自己的文件夹。所以要解决,我做了:
conda install nose-parameterized
答案 1 :(得分:0)
以下对我有用:
pip install nose-parameterized