(Re-)Installing Python (Anaconda), Pyomo and GLPK – the only economic modelling software you’ll ever need.

With disaster comes opportunity  

Due to a computer disaster we recently had to reinstall everything, and we think we’re almost working to our old capacity. Some of the recovery has not been easy, but one thing that was simple was to re-install Anaconda/Python, Pyomo and the GLPK linear program solver.

 

The reason it’s simple is we left an easy-to-follow guide here. It was in fact our first ever real post way back in December 2019 (our welcome massage was technically the first).

 

That seems like a lifetime, or at least a pandemic and societal lockdown ago.

 

Four and a half-years later, out guide still works.

 

The only difference is GLPK is now here – everything else is the same.

 

We now recommend you install the Python ‘schemdraw’ package, which will allow you to do kickass flow diagrams as in our Quarterly State Accounts Technical Paper. The engineers out there can also use it for great electrical flow diagrams.

 

Just go to the Anaconda prompt as shown in our guide and type:

 

pip install schemdraw

 

and hit ‘enter’ (don’t forget to only use one ‘e’ in ‘schem’).

 

The new version of Version of Anaconda, after another prompted upgrade, is now 2.5.1. Most importantly for us, the new version of the Spyder Integrated Development Environment (IDE) is 3.11, up from 3.9.

 

The only practical change we can pick in the new version is that the ‘append’ command is  now depricated and no longer works. No worries, just use the ‘concat’ command:

 

TFI_benchmarked_to_GVA_Final=TFI_benchmarked_to_GVA_adj_div4.append(TFI_benchmarked_to_GVA_adj_partYear)

 

to:

 

TFI_benchmarked_to_GVA_Final=pd.concat([TFI_benchmarked_to_GVA_adj_div4,(TFI_benchmarked_to_GVA_adj_partYear)])

 

At our day-job, the kids are using Jupyter notebooks to do Python programming, which is fine, but we preferer Spyder. If you do like Jupyter, no problem because its in the Anaconda install.

 

Other kids at our day-job are ‘r’ fans. Learning ‘r’ has been on our  agenda for a long time, but we can never find the need required to put in the mental effort. The general consensus is that ‘r’ is better for statistics than Python, but we don’t do that much complex statistics anymore. 

 

Regardless, ‘r’ is included in the Anaconda environment. Everyone wins!

 

Enjoy.