Setting the Python environment
1. Python requirements
Module |
Version |
mpi4py |
3.0 |
sympy |
1.1 |
2. Using virtualenv
for development
To develop Feel++ applications in Python, it is strongly suggested that you create a protected Python environment using e.g. virtualenv
.
Virtualenv
is a tool used to create an isolated Python environment.
The environment has its own installation directories, the libraries are not shared with other virtualenv
environments.
It doesn’t access the globally installed libraries either.
virtualenv
allows to create a custom user-based environment where experiments can be easily done during the development process.
The steps are as follows:
-
install
virtualenv
pip3 install virtualenv
and check the full path of the environment
which virtualenv
-
create a virtual environment using
python3
> which python3 /usr/bin/python3 > mkdir pyfeelpp-env > virtualenv ~/pyfeelpp-env -p /usr/bin/python3
The last command creates a local copy of your environment. While working on this pyFeel++, you should activate the local environment in order to make sure you’re working with the right versions of your tools and packages.
-
activate the environment
> cd pyfeelpp-env > . bin/activate
-
configure Feel++ using
cmake
orconfigure
with the environment activated so that themake install
procedure installs pyFeel++, pyFeel++ Toolboxes and pyFeel++ MOR in the virtual environment where you can test it safely.