编译python包时的错误' hyperopt'

时间:2017-06-26 15:31:14

标签: python

Github克隆包Hyperopt

创建了virtualenv,并运行命令python setup.py install

成功执行setup.py之后。当我运行THEANO_FLAGS=device=cpu shovel lfw.random_driver --max_n_per_class=20时 测试代码是否已正确安装。我遇到了以下错误。

No handlers could be found for logger "hpconvnet.utils"
/home/narak/Desktop/hyperopt-convnet/myhyper/lib/python2.7/site-packages/scikit_learn-0.18.2-py2.7-linux-x86_64.egg/sklearn/cross_validation.py:44: DeprecationWarning: This module was deprecated in version 0.18 in favor of the model_selection module into which all the refactored classes and functions are moved. Also note that the interface of the new CV iterators are different from that of this module. This module will be removed in 0.20.
  "This module will be removed in 0.20.", DeprecationWarning)
[ERROR] Failed to run task random_driver
Traceback (most recent call last):
  File "build/bdist.linux-x86_64/egg/shovel/tasks.py", line 243, in __call__
    return self._obj(*args, **kwargs)
  File "/home/narak/Desktop/hyperopt-convnet/shovel/lfw.py", line 64, in random_driver
    space=search_space(bagging_fraction=1.0),
  File "/home/narak/Desktop/hyperopt-convnet/hpconvnet/lfw.py", line 92, in build_search_space
    'ctrl': hyperopt.Bandit.pyll_ctrl,
AttributeError: 'module' object has no attribute 'Bandit'
Traceback (most recent call last):
  File "/home/narak/Desktop/hyperopt-convnet/myhyper/bin/shovel", line 4, in <module>
    __import__('pkg_resources').run_script('shovel==0.3.0', 'shovel')
  File "/home/narak/Desktop/hyperopt-convnet/myhyper/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 719, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/home/narak/Desktop/hyperopt-convnet/myhyper/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1511, in run_script
    exec(script_code, namespace, namespace)
  File "/home/narak/Desktop/hyperopt-convnet/myhyper/local/lib/python2.7/site-packages/shovel-0.3.0-py2.7.egg/EGG-INFO/scripts/shovel", line 25, in <module>

  File "build/bdist.linux-x86_64/egg/shovel/runner.py", line 119, in run
  File "build/bdist.linux-x86_64/egg/shovel/tasks.py", line 246, in __call__
AttributeError: 'module' object has no attribute 'Bandit'

我检查了Bandit是否已安装。通过import bandit,它成功了。

0 个答案:

没有答案