【问题标题】:Getfem++ is installed on Ubuntu 18.04, but it is not workingGetfem++ 已安装在 Ubuntu 18.04 上,但无法正常工作
【发布时间】:2021-09-08 21:09:21
【问题描述】:

我在 Ubuntu 18.04 中使用这两行代码安装了 Python GetFEM++

sudo apt-get update
sudo apt-get install python-getfem++

然后我开始在 Anaconda 上编写代码,

import getfem
m = mesh('cartesian', range(0, 3), range(0,3))

我收到了这个错误:

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-9-7f9e03c41e63> in <module>
      1 import getfem
----> 2 m = mesh('cartesian', range(0, 3), range(0,3))

NameError: name 'mesh' is not defined

我该怎么办?是否需要更新 Ubuntu 18.04 或安装其他软件包?

【问题讨论】:

    标签: python python-3.x debian ubuntu-18.04


    【解决方案1】:

    应该是

    import getfem
    m = getfem.Mesh('cartesian', range(0, 3), range(0,3))
    

    import getfem as gf
    m = gf.Mesh('cartesian', range(0, 3), range(0,3))
    

    【讨论】:

      猜你喜欢
      • 2015-09-18
      • 2020-04-09
      • 2011-12-18
      • 2017-10-05
      • 2015-02-05
      • 2015-03-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多