Using Python for Agent-based modeling – the beginning of a quest of a Windows 7 Enterprise user (in 8 steps)

First challenge: Figure out how to install it in the university computer. I have gone through some comes and goes… but here I am going to explain straightforwardly – to save your time.

Procedure bellow

1. Go to ==> Put the mouse of “Downloads” ==> Get the newer version (in my case 3.6.0 – and it is worth to mention that MESA only runs on versions >= 3) ==> Run the exe file “python-3.6.0.exe”
Python installed.
But it is not enough. You now need the “pip” in order to be able to install the Agent-based-modelling application. And it is done through the command
window from the windows. Everything you need to install in python is done through this pip. I think I have spent 1/2 hour trying to figure out how to do this @@$#^%.

First you need to know where you Python is located.

2. In the Start Menu, find the Python folder and right click on the IDLE file (“IDLE (Python 3.6 32-bit)”) and click in ‘Properties’ to find out where it is located in your computer.
2.1. Copy the content in the field ‘Target’. In mine it was “C:\Users\LocalAdmin\AppData\Local\Programs\Python\Python36-32\pythonw.exe “C:\Users
For the command window, you’ll only need the pathway until the python36-32, that is: “C:\Users\LocalAdmin\AppData\Local\Programs\Python\Python36-32\”

PIC python proc 1

3. Call the command window. You can open the start menu and type ‘cmd’.

4. Check for which folder your cmd is pointing. Mine was for “C:\Users\LocalAdmin\”
It means that you have to change the directory to the one where the python application is installed (in my case that is to the folder “python36-32”).
So, I changed directory by typing: “cd AppData\Local\Programs\Python\Python36-32” (without the quotation marks)

PIC python proc 2

5. Ok. Once the command window is pointing to the right folder, now you should upgrade the pip file.
This is because the python versions >= 3.4 already come with a pip, but you have to upgrade it to guarantee the latest version is being used.

6. To upgrade the pip [in windows], type in your command window: “python -m pip install -U pip” (without the quotation marks)
Now, you can start breathing with python. kkkkk

PIC python proc 3

Now you should install the ABM application for Python. I am using MESA from the guys from

7. To do so type in your command window: “python -m pip install mesa” (without the quotation marks)
Voila! You now have MeSA installed!

PIC python proc 3

Later on, when I was super happy and went to try to model an example, I discovered that I had to have a text editor to write my code on it. hauhauha it may seem silly, but i was expecting an application with interface, with built-in functions and so on… not a sheet o paper. XD But ok. I am (re)discoverying that I love to do this kind of things (I wanted to say “fuçar” for those who speak portuguese).

So yeah, you need a text editor, and the guys from ProjectMesa mention the The Jupyter Notebook, through which you can Write the model interactively
(seja lah o que isso significa rsrsrs). So, I downloaded it. And NOW it is easier through the command window.

8. Installing the Jupyter notebook: type “python -m pip install jupyter”
And voila!!

PIC python proc 5

Para os que falam portugues, o pulo do gato foi descobrir o caminho de upgrade do pip como “python -m pip…” Antes disso tava batendo cabeca.

Well, now I am going home to have some rest. I hope that I continue on this quest. If so, I will share the most I can here.
Hope it is useful for somebody. =D Any comments, suggestions, questions please do not hesitate to right down (if they are supposed to contribute, of

My sources of salvation (thank you all!):
Python for beginners –>
How to Install Python PIP on Windows 8 / Windows 10 –>
Mesa is a agent-based modeling framework in Python –>
Installation/upgrade of pip –>
Installation of Jypiter notebook –>


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s