编译和安装 cantera python 模块时遇到问题
我正在尝试在 Ubuntu linux 中将 Cantera 作为 python 模块安装。作为参考,我使用了以下说明: 安装 Cantera。运行 ./preconfig
和 make
后,出现以下错误:
fatal error: numarray/arrayobject.h: No such file or directory
根据 preconfig 文件,
# If numpy was installed using the --home option, set this to the
# home directory for numpy. This will be needed for all numpy installations
# that don't put the include files into python's native include directory.
#NUMPY_HOME=${NUMPY_HOME:="$HOME/python_packages"}
我使用的是学生版 Enthought Python Distribution 所以我想也许我需要将最后一行更改为:
NUMPY_HOME=${NUMPY_HOME:="/usr/local/EPD/lib/python2.7/site-packages/"}
但这不起作用。我仍然遇到同样的错误。想法?我已经安装了 python-dev 来修复早期的错误,所以不是这样。
I'm attempting to install the Cantera as a python module within Ubuntu linux. For reference I used these instructions: Installing Cantera. After running ./preconfig
and make
, I get the following error:
fatal error: numarray/arrayobject.h: No such file or directory
According to the preconfig file,
# If numpy was installed using the --home option, set this to the
# home directory for numpy. This will be needed for all numpy installations
# that don't put the include files into python's native include directory.
#NUMPY_HOME=${NUMPY_HOME:="$HOME/python_packages"}
and I'm using the student version of Enthought Python Distribution so I thought maybe I need to change the last line to:
NUMPY_HOME=${NUMPY_HOME:="/usr/local/EPD/lib/python2.7/site-packages/"}
but this is not working. I still get the same error. Thoughts? I've installed python-dev to fix an earlier bug so that's not it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您的 Ubuntu 机器上可能有多个
Python
发行版。在为了使用
EPD
安装Cantera
您应该明确告诉它使用哪个发行版:
每个发行版都有自己的
site-packages
目录,因此指定
PYTHON_CMD
您还可以指定要使用的site-packages
。安装
Numpy
时,它还会安装Numarray
的接口site-packages/numpy/core/include/numpy
,所以不需要下载
Numarray
。此外,numpy
已安装到site-packages
EPD
目录,因此NUMPY_HOME
(仅当numpy
未安装在默认目录中)应保持原样。希望
这有帮助。
You probably have several
Python
distributions on your Ubuntu box. Inorder to use
EPD
to installCantera
you should tell it explicitlywhich distribution to use:
Every distribution has its own
site-packages
directory, so byspecifying
PYTHON_CMD
you also specify whichsite-packages
to use.When
Numpy
is installed, it also installs interfaces toNumarray
tosite-packages/numpy/core/include/numpy
, so there is no need todownload
Numarray
. Also,numpy
is installed tosite-packages
directory of
EPD
, soNUMPY_HOME
(which is used only whennumpy
is not installed in the default directory) should be left intact. Hope
this helps.
我找到了解决方法。按照 我之前遵循了这些说明,我让它工作了。不同的是,上次我下载了 tar.gz 文件,而这次我使用了 subversion 存储库,我猜它可能更新得更多。无论如何,它有效,而且我也不需要更改默认的 python 命令。
编辑:我确实需要将其从默认值更改为:
我想最好也发布说明,以便其他用户可以在此处使用它们:
I found a fix. By following these instructions that I had previously followed, I got it to work. The difference is that the last time, I downloaded the tar.gz file, and this time, I used the subversion repository, which might be more updated I guess. Anyway, it worked, and I did not need to change the default python command either.
Edit: I did need to change this from the default to:
I guess it's a good idea to also post the instructions so they're available here for other users:
我们从来没有通过在 pre_config 中设置 include 变量来让它工作。相反,我们这样做:
自从我们开始包含这一点以来,没有遇到任何问题。
We've never gotten it to work by just setting the include variable in pre_config. Instead, we do:
Haven't had any issues since we've started including that.