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

'IndexedUncParam' object has no attribute '_index' #2

Open
rnquezada opened this issue Aug 5, 2022 · 5 comments
Open

'IndexedUncParam' object has no attribute '_index' #2

rnquezada opened this issue Aug 5, 2022 · 5 comments

Comments

@rnquezada
Copy link

Hi, I already install git and romodel package. I run the Knapsack problem code and got the following error:

ERROR: Constructing component 'w' from data=None failed: AttributeError:
'IndexedUncParam' object has no attribute '_index'
Traceback (most recent call last):

File ~\OneDrive - Colbun S.A\12 Colbún\11 PPA Optimo\Corrida\robust.py:64 in
m = Knapsack()

File ~\OneDrive - Colbun S.A\12 Colbún\11 PPA Optimo\Corrida\robust.py:33 in Knapsack
M.w = UncParam(M.ITEMS, uncset=M.E, nominal=w)

File ~\Anaconda3\lib\site-packages\pyomo\core\base\block.py:544 in setattr
self.add_component(name, val)

File ~\Anaconda3\lib\site-packages\pyomo\core\base\block.py:1089 in add_component
val.construct(data)

File ~\Anaconda3\lib\site-packages\romodel\uncparam.py:219 in construct
for ndx in self._index:

AttributeError: 'IndexedUncParam' object has no attribute '_index'

Do you know what could be the problem?

Thanks.

@tambesupriya
Copy link

Hi,

I am also getting the same error. Do you get the workaround of this issue? please let me know

@ddceruti
Copy link

+1 this issue since I am also getting it.

@ddceruti
Copy link

ddceruti commented Nov 11, 2022

@tambesupriya @rnquezada I have solved this issue by specifying the pyomo version and not installing from the pip command, since setup.py and requirements specify >=6.0, which is ahead of the romodel code. Additionally I have noticed that the release information printed out while installing is not updated (version is v.0.1.0 but the shown information while installing is v.0.0.2).

My quick fix is therefore to specify "pyomo==6.0" and "pyutilib" in the requirements.txt and setup.py and try again.

@tambesupriya
Copy link

Thanks @ddceruti for fixing this issue. This works for me also. Which python version(2 or 3) are you using? I am using 3. Are you able to executes all examples along with the output of objective function?

@ddceruti
Copy link

Which python version(2 or 3) are you using? I am using 3. Are you able to executes all examples along with the output of objective function?

I was using python 3.10 and did not throughly check the other problems. Glad you could quickfix the issue.

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

3 participants