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 {pyfeelpp}, 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 {pyfeelpp}, {pyfeelpptb} and {pyfeelppmor} in the virtual environment where you can test it safely.