让热情的Python发行版与COPASI和libsbm合作

2024-05-13 00:23:10 发布

您现在位置:Python中文网/ 问答频道 /正文

我使用Python发行版(学术版)已经有一段时间了,但是我一直在尝试为一个项目安装一些额外的包,并且遇到了由于我对命令行相对缺乏经验而产生的问题。在

这些是:

  • 科帕西
  • 图书馆
  • 矮胖的

最后一个运行得很好,一个简单的python setup.py install,一切似乎都运行得很好。但科帕西和libSBML似乎都不起作用。在

导入其中任何一个都是对“ImportError:No module named COPASI/libsbml”进行调整。在

我根据directions here安装libSBML,并使用this suggested workaround让它与enhoush一起工作,但没有用。对于COPASI,我按照指示安装了COPASI,并遵循以下Python绑定说明:

Once you downloaded the binary package for the Java bindings you have to unpack it. It will be unpacked to a directory called copasi_python. This directory contains the native library, a python file, a documentation file and the license file. It also contains a directory called unittests with lots of unittests that can be used to check if the bindings are working.

To run the unittests, you first have to set the PYTHONPATH environment variable to the directory where the native library and the COPASI.py file are located. Once you changed into the unittests directory you find a file called runTests.py which runs all the unittests in the directory.

我编辑的.bash_配置文件现在如下所示:

export PATH="/Library/Frameworks/EPD64.framework/Versions/Current/bin:${PATH}"
export PYTHONPATH=/usr/local/lib/python2.7/site-packages
export PYTHONPATH=/Applications/COPASI/copasi35_python27_macosx107_x64:$PYTHONPATH

第一行是将EPD设为默认的python解释器,第二行是上面建议的解决方法的结果,第三行是根据COPASI的指令。你知道我做错什么了吗?在


Tags: thetopyyouexportbindingsdirectoryfile