1

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.

Airwaves12
  • 11
  • 2
  • (*Spyder maintainer here*) Please post a small example code that generates this problem, so we can try to reproduce it in our side. That way we'll be able to understand what's happening in your case. – Carlos Cordoba Oct 22 '20 at 14:23
  • For example the script "ft01_poisson.py" from https://fenicsproject.org/tutorial/ which already generates an error when importing fenics. – Airwaves12 Oct 23 '20 at 14:25
  • Sorry but if you're getting an error while importing fenics, that means the problem is not directly related to Spyder and I can't help you with it. – Carlos Cordoba Oct 24 '20 at 13:02

0 Answers0