These installation instructions are for people who want to develop PyFBA
and/or for some reason do not want to use
conda
.
If you want to use PyFBA
for flux balance analysis, we strongly recommend you use conda
to install it:
conda create -n pyfba -c bioconda pyfba
conda activate pyfba
pyfba -v
pyfba help
If you want to install PyFBA
for development, we recommend a simple process:
- Use
conda
to install glpk. It really helps! - Clone this git repository
- Create a virtual environment.
- Install the prerequisites
- Build and install PyFBA.
conda create -n glpk -c conda-forge glpk
conda activate glpk
git clone https://github.com/linsalrob/PyFBA.git
cd PyFBA
virtualenv venv
source venv/bin/activate
pip install -r requirements.txt
python setup.py install
This will create a virtural environment called venv
and install the requirements and PyFBA
in that environment.
Note: I usually run which pip
or which python
after sourcing the virtual environment to make sure I am working
where I think I am.
You don't have to use conda, even though we highly, highly recommend it. The main problem will be installing glpk
To install PyFBA we first need to install a linear solver. We use the GNU Linear Programming Kit GLPK program as our linear solver, although you can use others.
There are plenty of websites detailing how to install it. Older versions of this document detail installing it on CentOS, MacOS, and Windows. But now we use conda, and we have not maintained those instructions.
Once you have glpk installed, the instructions above should work.
We have provided a test suite in tests folder and you can run all of them with nosetests tests/
. They
should all run without an error, and will test different aspects of the PyFBA installation.
If you download and install the code from GitHub, you can also run:
python setup.py test
to run all the tests