Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation with pyomo 5.7 fails #130

Open
tomaszG247 opened this issue Jun 22, 2020 · 2 comments
Open

Installation with pyomo 5.7 fails #130

tomaszG247 opened this issue Jun 22, 2020 · 2 comments

Comments

@tomaszG247
Copy link

Dear all,

thanks for your work on Switch. It seems really interesting.
However, I failed to install Switch and run examples. I have installed both from conda and in dev mode with pip install with the same results. when running most tests or examples, I get the error

Traceback (most recent call last):
  File "C:\Users\TGi\AppData\Local\Continuum\anaconda3\envs\switch\Scripts\switch-script.py", line 9, in <module>
    sys.exit(main())
  File "C:\Users\TGi\AppData\Local\Continuum\anaconda3\envs\switch\lib\site-packages\switch_model\main.py", line 39, in main
    main()
  File "C:\Users\TGi\AppData\Local\Continuum\anaconda3\envs\switch\lib\site-packages\switch_model\solve.py", line 90, in main
    model = create_model(modules, args=args)
  File "C:\Users\TGi\AppData\Local\Continuum\anaconda3\envs\switch\lib\site-packages\switch_model\utilities.py", line 100, in create_model
    module.define_components(model)
  File "C:\Users\TGi\AppData\Local\Continuum\anaconda3\envs\switch\lib\site-packages\switch_model\generators\core\no_commit.py", line 83, in define_components
    rule=lambda m:
  File "C:\Users\TGi\AppData\Local\Continuum\anaconda3\envs\switch\lib\site-packages\pyomo\core\base\set.py", line 2208, in __init__
    Set.__init__(self, **kwds)
  File "C:\Users\TGi\AppData\Local\Continuum\anaconda3\envs\switch\lib\site-packages\pyomo\core\base\set.py", line 1934, in __init__
    IndexedComponent.__init__(self, *args, **kwds)
  File "C:\Users\TGi\AppData\Local\Continuum\anaconda3\envs\switch\lib\site-packages\pyomo\core\base\indexed_component.py", line 182, in __init__
    Component.__init__(self, **kwds)
  File "C:\Users\TGi\AppData\Local\Continuum\anaconda3\envs\switch\lib\site-packages\pyomo\core\base\component.py", line 402, in __init__
    % ( type(self).__name__, ','.join(sorted(kwds.keys())) ))
ValueError: Unexpected keyword options found while constructing 'AbstractOrderedSimpleSet':
        rule

It seems this has to do with Pyomo. I have tried installing older versions of Pyomo instead (4.4.1 and 5.6.4) but then there was another error:

Traceback (most recent call last):
  File "C:\Code\switch\switch-model\tests\utilities_test.py", line 26, in test_save_inputs_as_dat
    return_model=True, return_instance=True
  File "C:\Code\switch\switch-model\switch_model\solve.py", line 90, in main
    model = create_model(modules, args=args)
  File "C:\Code\switch\switch-model\switch_model\utilities.py", line 100, in create_model
    module.define_components(model)
  File "C:\Code\switch\switch-model\switch_model\generators\core\no_commit.py", line 83, in define_components
    rule=lambda m:
  File "C:\Users\TGi\AppData\Local\Continuum\anaconda3\envs\switch\lib\site-packages\pyomo\core\base\set.py", line 2208, in __init__
    Set.__init__(self, **kwds)
  File "C:\Users\TGi\AppData\Local\Continuum\anaconda3\envs\switch\lib\site-packages\pyomo\core\base\set.py", line 1934, in __init__
    IndexedComponent.__init__(self, *args, **kwds)
  File "C:\Users\TGi\AppData\Local\Continuum\anaconda3\envs\switch\lib\site-packages\pyomo\core\base\indexed_component.py", line 182, in __init__
    Component.__init__(self, **kwds)
  File "C:\Users\TGi\AppData\Local\Continuum\anaconda3\envs\switch\lib\site-packages\pyomo\core\base\component.py", line 402, in __init__
    % ( type(self).__name__, ','.join(sorted(kwds.keys())) ))
ValueError: Unexpected keyword options found while constructing 'AbstractOrderedSimpleSet':
        rule

I am using python 3.7.
thank you for your help.

T

@pjalet
Copy link

pjalet commented Jun 22, 2020

Same here, with an install in a fresh Conda environment. Downgrading to Pyomo 5.6.9 and pyutilib 5.8.0 fixes the error (but many warnings: "The default domain for Param objects is 'Any'. However, we will be changing that default to 'Reals' in the future. If you really intend the domain of this Param (trans_dbid) to be 'Any', you can suppress this warning by explicitly specifying 'within=Any' to the Param constructor. (deprecated in 5.6.9, will be removed in 6.0))

@tomaszG247
Copy link
Author

Works for me. Same warnings. As a side note, the setup.py is missing glpk in the install_requires section I think. Finally, conda install coincbc does not work on Windows only on Mac and Linux according to the anaconda website.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants