MISP requires a couple of python libraries to be installed for the entire set of functionalities to work properly.
These functionalities include for instance the different import and export tools, the binaries extraction from attachments or PyMISP.
------
## Installation
We started using virtual environments in MISP to make the installation and maintenance of the python versions easier.
Either using the [installation script](https://github.com/MISP/MISP/blob/2.4/INSTALL/INSTALL.sh) to setup a running MISP on your machine, or starting using the automatically generated [virtual machine](https://www.circl.lu/misp-images/latest/) will give you access to the latest version of the required python libraries installed within a virtual environment called `virtualenv`.
But if you are using an older MISP version, you may want to install the virtual environment
If you already have a `venv` directory, you can skip this step
------
## Updating MISP and its dependencies
Keeping MISP up-to-date as much as possible is the safest way to avoid most of the potential issues.
It can be done either by using the Update button in the diagnostic tool available with the MISP UI, or by using the command line.
### Updating MISP core
In order to update MISP dependencies, we first want to pull the latest MISP version, so we have the latest submodule references as well.
![Update MISP from the diagnostic tool in the UI](figures/update_diagnostic.png)
OR
~~~~bash
sudo -H -u www-data git pull origin 2.4
~~~~
Once we have the latest MISP update, we can start updating the python libraries.
### Updating the python dependencies
MISP is provided with a lot of submodules used to ensure all the additional functionalities work as expected. Thus it is important to keep those dependencies up-to-date.
Note that if any of the STIX, Cybox, mixbox or MAEC update fails because of a `No such file or directory` error, you just have to `git clone` them and start again the `pip` command above.
Another set of dependencies you may want to update are MISP modules.
MISP modules have their own dependencies that need to be up-to-date as well as the modules scripts themselves.
**Note that the following instructions consider your MISP modules are installed in the default path where we install them on our virtual machine or following the install script. Please change the path accordingly if needed.**
You will then need to restart the modules, please refer to the [documentation](https://github.com/MISP/misp-modules#how-to-install-and-start-misp-modules-in-a-python-virtualenv-recommended).