# Configuring PyCharm for FEniCSx installed on macOS (via conda)

**URL:** <https://fenicsproject.discourse.group/t/configuring-pycharm-for-fenicsx-installed-on-macos-via-conda/13428>\
**Category:** installation\
**Created:** [January 27, 2024, 10:58am UTC](https://fenicsproject.discourse.group/t/configuring-pycharm-for-fenicsx-installed-on-macos-via-conda/13428 "2024-01-27T10:58:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kau](https://avatars.discourse-cdn.com/v4/letter/k/aeb1de/32.png) [@kau](https://fenicsproject.discourse.group/u/kau)\
**Post date:** [January 27, 2024, 10:58am UTC](https://fenicsproject.discourse.group/t/configuring-pycharm-for-fenicsx-installed-on-macos-via-conda/13428/1 "2024-01-27T10:58:39Z")

</div>

Dear all,  
I’m a new user of FEniCSx and learning it for my research. I have a question regarding the configuration of PyCharm for using FEniCSx installed on macOS via conda.

**Installation and system details**  
System details:  
MBP (Apple M2 chip) with Sonoma 14.3  
Installation details:  
I installed FEniCSx using conda as recommended on the GitHub [README](https://github.com/FEniCS/dolfinx#conda)

**Problem Description**  
To check my installation, I ran the code [demo\_poisson.py](https://docs.fenicsproject.org/dolfinx/main/python/demos/demo_poisson.html#poisson-equation) from PyCharm IDE. However, I get the following error:

> cffi.VerificationError: CompileError: command ‘/Users/kau/opt/miniconda3/envs/fenics/bin/clang’ failed with exit code 1

This is caused when creating `function space` **V** on the mesh: `V = fem. function space(msh, ("Lagrange", 1))` because of the following message

> In file included from Libffcx\_elements\_6d5ea566818a6d6eef9b766d19b87bfe92  
> 54cbdd.c: 57:  
> /Users/kau/opt/miniconda3/envs/fenics/ include/python3.12/Python.h:23:12: fatal error: ’ stdlib.h’ file not found  
> `# include <stdlib.h>`

**Workaround solution**  
I found that when I run the Python script directly via the terminal, it executes perfectly as intended. After the execution via the terminal, if I run the same script via PyCharm, it works as well.  
However, if I change my _mesh_ and _function space_, then the code again throws the same error (when I run it directly via PyCharm), and I need to run it via the terminal to be able to run it via PyCharm.

**Question**  
Is there a way with which I can run the code in the first go via PyCharm? Any plugins, changes in environment variables or packages?

Thank you for any help that you can provide.

---

<div class="post-metadata">

**Author:** ![tomd](https://avatars.discourse-cdn.com/v4/letter/t/b4bc9f/32.png) [@tomd](https://fenicsproject.discourse.group/u/tomd)\
**Post date:** [April 9, 2024, 1:18pm UTC](https://fenicsproject.discourse.group/t/configuring-pycharm-for-fenicsx-installed-on-macos-via-conda/13428/2 "2024-04-09T13:18:26Z")

</div>

Did you find a reliable solution? I am having the same issue with a Jupyter notebook running in VSCode on MacOS Sonoma.

---

<div class="post-metadata">

**Author:** ![kau](https://avatars.discourse-cdn.com/v4/letter/k/aeb1de/32.png) [@kau](https://fenicsproject.discourse.group/u/kau)\
**Post date:** [April 10, 2024, 9:45am UTC](https://fenicsproject.discourse.group/t/configuring-pycharm-for-fenicsx-installed-on-macos-via-conda/13428/3 "2024-04-10T09:45:07Z")

</div>

No, unfortunately not. I still use the workaround solution. ☹
