Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pip install hyperopt and hyperas fail

Tags:

python

I was trying to install hyperopt, but I got the following error:

Collecting hyperopt
Using cached hyperopt-0.0.2.tar.gz
Complete output from command python setup.py egg_info:
DEBUG:root:distribute_setup.py not found, defaulting to system setuptools
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/tmp/pip-build-gmhldfe7/hyperopt/setup.py", line 119, in <module>
    if package_data is None: package_data = find_package_data(packages)
  File "/tmp/pip-build-gmhldfe7/hyperopt/setup.py", line 102, in find_package_data
    for subdir in find_subdirectories(package):
  File "/tmp/pip-build-gmhldfe7/hyperopt/setup.py", line 73, in find_subdirectories
    subdirectories = os.walk(package_to_path(package)).next()[1]
AttributeError: 'generator' object has no attribute 'next'

----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-gmhldfe7/hyperopt/

And I got the same error when intalling hyperas. But I can install ggplot successfully by using pip command. I am using Ubuntu 14.04 and Python 3.5.

Thanks.

like image 645
Gejun Avatar asked Mar 14 '16 02:03

Gejun


1 Answers

This is a bug in hyperopt. generator.next was renamed to generator.__next__ which can be invoked with next(generator) in Python3.

Here is the PEP detailing the change.

Looks like it was fixed in master but never released. You can install from git (which means github as well) by doing the following:

pip install git+https://github.com/hyperopt/hyperopt.git
like image 187
dreamriver Avatar answered Nov 09 '22 10:11

dreamriver