Wie man pysb Exception behebt: The program BioNetGen was not found in the default search path(s) for your operating system
Problem
Beim Ausführen eines PySB-Modells sehen Sie eine Fehlermeldung wie
error-output.txt
Exception: The program BioNetGen was not found in the default search path(s) for your operating system:
/usr/local/share/BioNetGen
/usr/bin
/home/user/.local/bin
/home/user/.pyenv/shims
/home/user/.pyenv/bin
/usr/local/sbin
/usr/local/bin
/usr/sbin
/sbin
/bin
/usr/games
/usr/local/games
/snap/bin
Either install it to one of those paths, or set a custom path using the environment variable BNGPATH or by calling the function pysb.pathfinder.set_path()
Conda users can install BioNetGen using the following command:
conda install -c alubbock bionetgenLösung
Klonen Sie zuerst BioNetGen aus dem offiziellen Repository in einen Ordner Ihrer Wahl. In diesem Beispiel verwenden wir ~/bionetgen:
clone-bionetgen.sh
git clone --depth 1 -b BioNetGen-2.9.2 https://github.com/RuleWorld/bionetgen.gitSetzen Sie dann, bevor Sie pysb-Code ausführen, die Umgebungsvariable BNGPATH auf den Pfad, in den Sie BioNetGen geklont haben, indem Sie den folgenden Python-Code einfügen:
set-bngpath.py
import os
import os.path
os.environ['BNGPATH'] = os.path.expanduser('~/bionetgen/bng2')Beachten Sie, dass BNGPATH zwingend auf den Unterordner bng2 des geklonten BioNetGen-Repositories gesetzt werden muss!
Führen Sie Ihr gesamtes Programm erneut aus - nun sollte der Fehler verschwunden sein.
Check out similar posts by category:
Python
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow