How to use FEniCS in Spyder with Python 3.8?

1.6k Views Asked by At

I am quite new to python and only did smaller projects so far. For a new project I would like to use FEniCS for solving PDEs. I am working with Windows 10 and already successfully installed Ubuntu (I still do not entirely understand what Ubunutu is needed for). To test solving a PDE I executed a tutorial file "ft01_poisson.py" from the website of the FEniCS project (https://fenicsproject.org/tutorial/) in the Ubuntu command window and it worked.

Afterwards, I also wanted to execute the file in spyder since I will use Spyder for my own project to solve PDEs. I did pip install fenics and when I repeat the command it says Requirement already satisfied: fenics c:\users\airwaves12\anaconda3\envs\spyder-4.1.5\lib\site-packages (2019.1.0).

But when I execute the script in spyder I always get the error ModuleNotFoundError: No module named 'fenics'. In the above-mentioned path there are only folders called fenics_dijitso-2019.1.0.dist-info, fenics_ffc-2019.1.0.post0.dist-info, fenics_fiat-2019.1.0.dist-info, fenics_ufl-2019.1.0.dist-info and fenics-2019.1.0.dist-info. I know that the "fenics package" consists of different subpackages as "ffc", "FIAT", "ufl" or "dijitso". Those also excist in the above-mentioned file. I tried to manually copy those subpackages saved in folder called "fenics" into the path C:\Users\Airwaves12\anaconda3\envs\spyder-4.1.5\Lib\site-packages but that obviously did not work cause python did not find for example the function UnitSquareMesh().

I spend almost two days reading everything concerning this topic and tried out a lot of things but the most useful advice was from No module named 'dolfin' using Spyder which did not work for me and was originally just for anaconda. How to use FEniCS in Jupyter Notebook or Spyder? did not get an answer for spyder so far.

Does anyone know how to properly use FEniCS with spyder? I would be grateful for any advice.

0

There are 0 best solutions below