AnyPyTools - KeyError

Dear All,

I am trying to run a model from python with the help of anypytools. Python script we used works perfect on a different computer but when I try to work exactly the same script with same model on my computer I receive a KeyError. I do not know is this the right place to ask, but since I am trying to run Anybody with it, I wanted to ask.

Thank you all, I look forward to hearing from you soon.


Please update your profile with the name, affiliation.

At the moment I am not sure what is exactly wrong, but I could recommend you to check what version of AnyPyTools are being used. Since there is a difference on 2 computers - most likely the versions are not the same. I would recommend to roll back the AnyPyTools package if it used to work, or update to the newer if it is behind.

If that does not work - please let us know.

Kind regards,

Hello again,

Thank you for your fast return. As you said I updated my profile. I am using Anaconda 3 with spyder (python 3.6)." ", I used this steps to setup Anaconda 3 and the other computer that I mentioned also uses Anaconda 3 with spyder (python 3.6).

I used Anaconda command prompt to install anypytools. As far as I know anypytools I downloaded in that way is the latest version. Is it possible that earlier versions might not working in the newest update? Also I would be really glad if you tell me how can I learn the version of the anypytools that I am currently using.

I recently formatted my computer, and installed those softwares again, result is same, nothing changed. I believe my default spyder settings are causing the problem but I am not sure which settings.

Iif necessary, I can provide any additional information.

Thank you.
Ogulcan Guldeniz


Thank you.

“conda info anypytools” to see the version number.

I am still not quite sure what is wrong. Could you try to run from Jupyter: “jupyter notebook”? If that does not eliminate the problem. Then it is not environment specific. Do you run process many models at the same time? My colleagues just had a similar issue and it helped to reduce this number, which could also be a computer-specific, which would explain how it works on another machine if everything else is the same.

Kind regards,

Hey Pavel,

To begin with I checked my anypytools version. I am still not sure which version is the correct one so I attached a text file of the output that I get from command prompt about my version data.

I tried Jupyter also and get the same error. To the same text file right after version informations, I included the complete error explanation that I get from Jupyter. I thought it might be important to solve this issue.

Also like you said, I decreased the number of processes working at the same time to 1. did not made a difference. I did this change by changing this line.
" app = AnyPyProcess(num_processes = 1) "

Thank you for your support once again, I hope those informations may lead a solution to this issue. I look forward to hearing from you soon.

Best Regards,
Ogulcan Guldeniz

Hi Ogulcanguldeniz

You should use conda list anypytools to see which version of anypytools you have installed (if any.) conda info just shows you what versions are available online.

The error you are getting just indicate that the data is not available in your results. Why that happens is hard for me to say, if I can't see more of your code.

It could for example be:

  1. You are not outputting the variable in the macro. (This is probably not the case since you wrote that the same script worked on another computer).

  2. One of you macro simulations fails before it gets to the point where the variable are 'Dump'ed. This can easily happen if the model is not the same between the two computers or if there are issues with the version of AnyBody you are using.

Try to inspect what data is available in the results variable. You can maybe do that in Spyder, or just do print(results[0].keys())

If it doesn't solve your problem do you mind opening a new issue in the AnyPyTools issue tracker:

You can also find more information on the documentation web page for AnyPyTools: