fenics

No module named 'dolfin' using Spyder

有些话、适合烂在心里 提交于 2021-02-09 07:23:24
问题 I can't, for the life of me, get dolfin running with Spyder . That's what I thought at first. I managed to get it running somehow, but not in a convenient way. Here is the situation: The error conda activate fenics , spyder , from dolfin import * : No module named 'dolfin' . What works conda activate fenics , python , from dolfin import * : worked in the first place. conda activate fenics , ipython , from dolfin import * : worked after some tweaking. conda activate fenics , spyder , from

Can't view FEniCS figure at http://127.0.0.1:8000

十年热恋 提交于 2020-01-05 05:32:05
问题 I just started to use FEniCS with Python. I am using Docker and a FEniCS enabled terminal to run the programs. It works well to run programs in this way but I cannot access the figures. According to the terminal: "To view figure, visit http://127.0.0.1:8000", but when I enter "http://127.0.0.1:8000" into Safari it says "Safari can't connect to the server". I have tried different browsers but the problem remains. I am using a Mac computer with MacOS Sierra and a Netgear router. How can I

Run sequential commands in Python with subprocess

空扰寡人 提交于 2019-12-11 17:48:21
问题 hope you can help. I need, in my Python script, to run the software container Docker with a specific image (Fenics in my case) and then to pass him a command to execute a script. I've tried with subprocess: cmd1 = 'docker exec -ti -u fenics name_of_my_container /bin/bash -l' cmd2 = 'python2 shared/script_to_be_executed.py' process = subprocess.Popen(shlex.split(cmd1), stdout=subprocess.PIPE,stdin=subprocess.PIPE, stderr = subprocess.PIPE) process.stdin.write(cmd2) print(first_process.stdout