# Beginners in fenics

**URL:** <https://fenicsproject.discourse.group/t/beginners-in-fenics/16919>\
**Category:** General\
**Created:** [February 4, 2025, 1:01am UTC](https://fenicsproject.discourse.group/t/beginners-in-fenics/16919 "2025-02-04T01:01:51Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![roberto](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/roberto/32/8118_2.png) [@roberto](https://fenicsproject.discourse.group/u/roberto)\
**Post date:** [February 4, 2025, 1:01am UTC](https://fenicsproject.discourse.group/t/beginners-in-fenics/16919/1 "2025-02-04T01:01:51Z")

</div>

Good evening, everibody, Does fenics work with python or only with C++? Can I use visual studio code as an editor without creating a conflict?

---

<div class="post-metadata">

**Author:** ![dokken](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/dokken/32/1560_2.png) [@dokken](https://fenicsproject.discourse.group/u/dokken)\
**Post date:** [February 4, 2025, 4:52am UTC](https://fenicsproject.discourse.group/t/beginners-in-fenics/16919/2 "2025-02-04T04:52:56Z")

</div>

> [@roberto](#):
>
> Good evening, everibody, Does fenics work with python or only with C++

You can use FEniCS in either language. However, most users prefer the Python interface.

> [@roberto](#):
>
> Can I use visual studio code as an editor without creating a conflict?

Yes, you can. I’ve been using vscode for developing with FEniCS since 2020

---

<div class="post-metadata">

**Author:** ![roberto](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/roberto/32/8118_2.png) [@roberto](https://fenicsproject.discourse.group/u/roberto)\
**Post date:** [February 4, 2025, 12:39pm UTC](https://fenicsproject.discourse.group/t/beginners-in-fenics/16919/3 "2025-02-04T12:39:57Z")

</div>

Thanks for your answers dokken, I have tried to install fenics on my PC with a Windows 10 environment to work with Visual Studio code in Python 3.13.1 but I get an error when running the program. ModuleNotFoundError: No module named ‘fenics’, I have tried several times and nothing, I don’t know if you could help me with this?

---

<div class="post-metadata">

**Author:** ![Stein](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/stein/32/8751_2.png) [@Stein](https://fenicsproject.discourse.group/u/Stein)\
**Post date:** [February 4, 2025, 1:33pm UTC](https://fenicsproject.discourse.group/t/beginners-in-fenics/16919/4 "2025-02-04T13:33:50Z")

</div>

The module is called `dolfinx`, not `fenics`. Various beginner guides exist, which you’re encouraged to go through to get started. E.g., [The FEniCSx tutorial — FEniCSx tutorial](https://jsdokken.com/dolfinx-tutorial/) and the demos on [Demos — DOLFINx 0.9.0 documentation](https://docs.fenicsproject.org/dolfinx/v0.9.0/python/demos.html)

---

<div class="post-metadata">

**Author:** ![roberto](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/roberto/32/8118_2.png) [@roberto](https://fenicsproject.discourse.group/u/roberto)\
**Post date:** [February 4, 2025, 1:54pm UTC](https://fenicsproject.discourse.group/t/beginners-in-fenics/16919/5 "2025-02-04T13:54:52Z")

</div>

Thanks Stein, I have tried to install Petsc4py the following error appears  
\*\*\* Windows python detected. Please rerun ./configure with cygwin-python. \*\*\*  
===============================================================================  
Traceback (most recent call last):  
File “C:\Users\User\AppData\Local\Programs\Python\Python313\Lib\site-packages\pip\_vendor\pyproject\_hooks\_in\_process\_in\_process.py”, line 389, in   
main()  
~~~~ ^^  
File “C:\Users\User\AppData\Local\Programs\Python\Python313\Lib\site-packages\pip\_vendor\pyproject\_hooks\_in\_process\_in\_process.py”, line 373, in main  
json\_out[“return\_val”] = hook(\*\*hook\_input[“kwargs”])  
~~~~ ^^^^^^^^^^^^^^^^^^^^^^^^  
File “C:\Users\User\AppData\Local\Programs\Python\Python313\Lib\site-packages\pip\_vendor\pyproject\_hooks\_in\_process\_in\_process.py”, line 280, in build\_wheel  
return \_build\_backend().build\_wheel(  
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  
wheel\_directory, config\_settings, metadata\_directory  
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
)  
^  
File “C:\Users\User\AppData\Local\Temp\pip-build-env-7\_osh60f\overlay\Lib\site-packages\setuptools\build\_meta.py”, line 438, in build\_wheel  
return \_build([‘bdist\_wheel’, ‘–dist-info-dir’, str(metadata\_directory)])  
File “C:\Users\User\AppData\Local\Temp\pip-build-env-7\_osh60f\overlay\Lib\site-packages\setuptools\build\_meta.py”, line 426, in \_build  
return self.\_build\_with\_temp\_dir(  
~~~~~~~~~~~~~~~~~~~~~~~~~ ^  
cmd,  
^^^^  
…\<3 lines\>…  
self.\_arbitrary\_args(config\_settings),  
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
)  
^  
File “C:\Users\User\AppData\Local\Temp\pip-build-env-7\_osh60f\overlay\Lib\site-packages\setuptools\build\_meta.py”, line 407, in _build\_with\_temp\_dir  
self.run\_setup()  
~~~~~~~~~~~~~~ ^^  
File “C:\Users\User\AppData\Local\Temp\pip-build-env-7\_osh60f\overlay\Lib\site-packages\setuptools\build\_meta.py”, line 320, in run\_setup  
exec(code, locals())  
~~~~ ^^^^^^^^^^^^^^^^  
File “”, line 366, in   
File "C:\Users\User\AppData\Local\Temp\pip-build-env-7\_osh60f\overlay\Lib\site-packages\setuptools\_init_.py", line 117, in setup  
return distutils.core.setup(\*\*attrs)  
~~~~~~~~~~~~~~~~~~~~ ^^^^^^^^^  
File “C:\Users\User\AppData\Local\Temp\pip-build-env-7\_osh60f\overlay\Lib\site-packages\setuptools\_distutils\core.py”, line 186, in setup  
return run\_commands(dist)  
File “C:\Users\User\AppData\Local\Temp\pip-build-env-7\_osh60f\overlay\Lib\site-packages\setuptools\_distutils\core.py”, line 202, in run\_commands  
dist.run\_commands()  
~~~~~~~~~~~~~~~~~ ^^  
File “C:\Users\User\AppData\Local\Temp\pip-build-env-7\_osh60f\overlay\Lib\site-packages\setuptools\_distutils\dist.py”, line 983, in run\_commands  
self.run\_command(cmd)  
~~~~~~~~~~~~~~~~ ^^^^^  
File “C:\Users\User\AppData\Local\Temp\pip-build-env-7\_osh60f\overlay\Lib\site-packages\setuptools\dist.py”, line 999, in run\_command  
super().run\_command(command)  
~~~~~~~~~~~~~~~~~~~ ^^^^^^^^^  
File “C:\Users\User\AppData\Local\Temp\pip-build-env-7\_osh60f\overlay\Lib\site-packages\setuptools\_distutils\dist.py”, line 1002, in run\_command  
cmd\_obj.run()  
~~~~~~~~~~~ ^^  
File “C:\Users\User\AppData\Local\Temp\pip-build-env-7\_osh60f\overlay\Lib\site-packages\setuptools\command\bdist\_wheel.py”, line 414, in run  
self.run\_command(“install”)  
~~~~~~~~~~~~~~~~ ^^^^^^^^^^^  
File “C:\Users\User\AppData\Local\Temp\pip-build-env-7\_osh60f\overlay\Lib\site-packages\setuptools\_distutils\cmd.py”, line 339, in run\_command  
self.distribution.run\_command(command)  
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^^^^^^^^^  
File “C:\Users\User\AppData\Local\Temp\pip-build-env-7\_osh60f\overlay\Lib\site-packages\setuptools\dist.py”, line 999, in run\_command  
super().run\_command(command)  
~~~~~~~~~~~~~~~~~~~ ^^^^^^^^^  
File “C:\Users\User\AppData\Local\Temp\pip-build-env-7\_osh60f\overlay\Lib\site-packages\setuptools\_distutils\dist.py”, line 1002, in run\_command  
cmd\_obj.run()  
~~~~~~~~~~~ ^^  
File “”, line 289, in run  
File “”, line 192, in config  
RuntimeError: 3  
[end of output]

```
    note: This error originates from a subprocess, and is likely not a problem with pip.
    ERROR: Failed building wheel for petsc
  Failed to build petsc
  ERROR: Failed to build installable wheels for some pyproject.toml based projects (petsc)
  [end of output]

```

note: This error originates from a subprocess, and is likely not a problem with pip.  
error: subprocess-exited-with-error

× pip subprocess to install backend dependencies did not run successfully.  
│ exit code: 1  
╰─\> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

---

<div class="post-metadata">

**Author:** ![dokken](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/dokken/32/1560_2.png) [@dokken](https://fenicsproject.discourse.group/u/dokken)\
**Post date:** [February 4, 2025, 4:37pm UTC](https://fenicsproject.discourse.group/t/beginners-in-fenics/16919/6 "2025-02-04T16:37:24Z")

</div>

How did you install dolfinx/dolfin/fenics on your system?

---

<div class="post-metadata">

**Author:** ![Eduardo\_Firvida](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/eduardo_firvida/32/6932_2.png) [@Eduardo\_Firvida](https://fenicsproject.discourse.group/u/Eduardo_Firvida)\
**Post date:** [February 4, 2025, 7:43pm UTC](https://fenicsproject.discourse.group/t/beginners-in-fenics/16919/7 "2025-02-04T19:43:33Z")

</div>

You can also use devcontainerin vscode with the Fenicsx docker image

something like this

Dokerfile

```auto
FROM dolfinx/dolfinx:stable

.....

```

devcontainer.json

```auto
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-dockerfile
{
	"name": "project",
	"build": {
		// Sets the run context to one level up instead of the .devcontainer folder.
		"context": "..",
		// Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename.
		"dockerfile": "./Dockerfile"
	},
	"customizations": {
		"vscode": {
			"extensions": [
				"donjayamanne.python-extension-pack",
				"ms-python.python",
				"ms-python.vscode-pylance",
				"ms-toolsai.jupyter",
				"njpwerner.autodocstring",
				"ms-toolsai.datawrangler",
				"498.pythonformat"
			]
		}
	}
}

```
