【发布时间】:2017-02-04 05:41:51
【问题描述】:
我最近使用 Docker 通过以下命令安装了 FEniCS
Terminal> curl -s https://get.fenicsproject.org | bash
当我在fenicsproject 会话中时,一切都运行良好。在此会话中,当我使用 which python 时,我得到以下信息
fenics@7016ac685f58:~$ which python
/usr/bin/python
但是,当我尝试在 Jupyter Notebook 中使用以下命令时
from fenics import *
我收到以下错误
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-4-66a9e72f2de9> in <module>()
2 # Poisson solver in Python using FEniCS
3 # import FEniCS
----> 4 from fenics import *
5 #
6 # create mesh and denfine functional space
ImportError: No module named fenics
我使用的是anaconda提供的Python,下面给出了有关python的详细信息
Python 2.7.12 |Anaconda custom (x86_64)| (default, Jul 2 2016, 17:43:17)
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://anaconda.org
which python 给了我以下路径
h147:project0 vikas$ which python
/Users/vikas/anaconda/bin/python
我不知道如何解决这个问题。请帮我。
【问题讨论】:
-
@cel 感谢您的回复,我按照链接给出的指示执行了以下操作但是,当我尝试运行
from fenics import *时,我收到以下错误` ImportError Traceback(最近一次调用最后一次) ImportError: cannot import name cpp `