# No module named 'PyPulse' Error

**URL:** <https://discourse.kitware.com/t/no-module-named-pypulse-error/996>\
**Category:** Pulse Physiology Engine\
**Created:** [March 9, 2023, 6:21pm UTC](https://discourse.kitware.com/t/no-module-named-pypulse-error/996 "2023-03-09T18:21:57Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![JoseMG98](https://discourse.kitware.com/letter_avatar_proxy/v4/letter/j/c37758/32.png) [@JoseMG98](https://discourse.kitware.com/u/JoseMG98)\
**Post date:** [March 9, 2023, 6:21pm UTC](https://discourse.kitware.com/t/no-module-named-pypulse-error/996/1 "2023-03-09T18:21:57Z")

</div>

Followed the appropriate steps in the Wiki to get Pulse working on PyCharm. Attempted to run a HowTo scenario and the following received the following error

Traceback (most recent call last):  
File “C:\Windows\System32\Pulse\engine\src\python\pulse\howto\HowTo\_AirwayObstruction.py”, line 7, in   
from pulse.engine.PulseEngine import PulseEngine  
File “c:\windows\system32\pulse\engine\src\python\pulse\engine\PulseEngine.py”, line 6, in   
import PyPulse  
ModuleNotFoundError: No module named ‘PyPulse’

Attempted to install PyPulse in the PyCharm package manager. I have also checked the bin location and have this file “PyPulse.cp39-win\_amd64”

Unsure of what to do next to fix the errors shown.

---

<div class="post-metadata">

**Author:** ![abray](https://discourse.kitware.com/user_avatar/discourse.kitware.com/abray/32/12_2.png) [@abray](https://discourse.kitware.com/u/abray)\
**Post date:** [March 9, 2023, 6:29pm UTC](https://discourse.kitware.com/t/no-module-named-pypulse-error/996/2 "2023-03-09T18:29:26Z")

</div>

I edit the Run/Debug Configuration of HowTo\_AirwayObstruction.py and set the Working directory

 ![image](https://discourse.kitware.com/uploads/default/original/1X/39860ac74893fece68bdbee2e93d99d24091bc84.png)

Then I manually add these paths to my pycharm python interpreter (File-\>Settings)

 ![image](https://discourse.kitware.com/uploads/default/original/1X/fd30a0bba333e033695cbfa961601d093508a792.png)

---

<div class="post-metadata">

**Author:** ![abray](https://discourse.kitware.com/user_avatar/discourse.kitware.com/abray/32/12_2.png) [@abray](https://discourse.kitware.com/u/abray)\
**Post date:** [March 9, 2023, 6:33pm UTC](https://discourse.kitware.com/t/no-module-named-pypulse-error/996/3 "2023-03-09T18:33:06Z")

</div>

If my working directory was not set, PyCharm could not find the PyPulse.cp39-win\_amd64.pyd which give me the unable to find PyPulse… so I think setting that working directory should work

---

<div class="post-metadata">

**Author:** ![JoseMG98](https://discourse.kitware.com/letter_avatar_proxy/v4/letter/j/c37758/32.png) [@JoseMG98](https://discourse.kitware.com/u/JoseMG98)\
**Post date:** [March 9, 2023, 7:21pm UTC](https://discourse.kitware.com/t/no-module-named-pypulse-error/996/4 "2023-03-09T19:21:39Z")

</div>

I set the working directory to install\bin as well as added the same paths into the into the pycharm python interpreter. Same error occurred. Currently using Python 3.11, if that may help diagnose the issue further.

---

<div class="post-metadata">

**Author:** ![abray](https://discourse.kitware.com/user_avatar/discourse.kitware.com/abray/32/12_2.png) [@abray](https://discourse.kitware.com/u/abray)\
**Post date:** [March 9, 2023, 7:23pm UTC](https://discourse.kitware.com/t/no-module-named-pypulse-error/996/5 "2023-03-09T19:23:39Z")

</div>

> [@JoseMG98](#):
>
> PyPulse.cp39-win\_amd64

Since you built pulse with python 3.9  
You need to run a 3.9 interpreter in PyCharm  
Those have to match

---

<div class="post-metadata">

**Author:** ![JoseMG98](https://discourse.kitware.com/letter_avatar_proxy/v4/letter/j/c37758/32.png) [@JoseMG98](https://discourse.kitware.com/u/JoseMG98)\
**Post date:** [March 10, 2023, 1:37am UTC](https://discourse.kitware.com/t/no-module-named-pypulse-error/996/6 "2023-03-10T01:37:28Z")

</div>

Interpreter is now Python 3.9, but same error is occurring. All else appears to be equal when comparing screenshots

---

<div class="post-metadata">

**Author:** ![abray](https://discourse.kitware.com/user_avatar/discourse.kitware.com/abray/32/12_2.png) [@abray](https://discourse.kitware.com/u/abray)\
**Post date:** [March 10, 2023, 3:39am UTC](https://discourse.kitware.com/t/no-module-named-pypulse-error/996/7 "2023-03-10T03:39:53Z")

</div>

What branch are you building?

---

<div class="post-metadata">

**Author:** ![JoseMG98](https://discourse.kitware.com/letter_avatar_proxy/v4/letter/j/c37758/32.png) [@JoseMG98](https://discourse.kitware.com/u/JoseMG98)\
**Post date:** [March 10, 2023, 10:46am UTC](https://discourse.kitware.com/t/no-module-named-pypulse-error/996/8 "2023-03-10T10:46:37Z")

</div>

I actually think building my environment is where an issue is occurring now. After reinstalling Python 3.9 the code ran on PyCharm, but failed to find the initial state. I checked the files and some files were missing that were in my original attempt to build the environment

---

<div class="post-metadata">

**Author:** ![abray](https://discourse.kitware.com/user_avatar/discourse.kitware.com/abray/32/12_2.png) [@abray](https://discourse.kitware.com/u/abray)\
**Post date:** [March 10, 2023, 1:16pm UTC](https://discourse.kitware.com/t/no-module-named-pypulse-error/996/9 "2023-03-10T13:16:26Z")

</div>

States are genereated during the superbuild See here for [regeneration of states](https://gitlab.kitware.com/physiology/engine#regenerate-state-data)

If your build did not finish or you don’t have the expected files in your install/bin, you will also need to generate data via `run genData` before you `run genStates`

More on our run script can be [found here](https://gitlab.kitware.com/physiology/engine/-/wikis/home)

---

<div class="post-metadata">

**Author:** ![JoseMG98](https://discourse.kitware.com/letter_avatar_proxy/v4/letter/j/c37758/32.png) [@JoseMG98](https://discourse.kitware.com/u/JoseMG98)\
**Post date:** [March 10, 2023, 4:16pm UTC](https://discourse.kitware.com/t/no-module-named-pypulse-error/996/10 "2023-03-10T16:16:12Z")

</div>

I believe built the environment successfully into PyCharm as I am able to run the HowTo files successfully. However, trying to make our own code in the HowTo, it fails to find the initial state. I also receive this error

Traceback (most recent call last):  
File “C:\Programming\Pulse\engine\src\python\pulse\howto\Test.py”, line 50, in   
print(results[‘MeanArterialPressure (mmHg)’][0])  
KeyError: ‘MeanArterialPressure (mmHg)’

The written code was running in the Jupyter notebook, as that was where it was created. The only thing done was copying and pasting it over to PyCharm

---

<div class="post-metadata">

**Author:** ![abray](https://discourse.kitware.com/user_avatar/discourse.kitware.com/abray/32/12_2.png) [@abray](https://discourse.kitware.com/u/abray)\
**Post date:** [March 10, 2023, 4:30pm UTC](https://discourse.kitware.com/t/no-module-named-pypulse-error/996/11 "2023-03-10T16:30:15Z")

</div>

Make sure you set the working directory in the configuration  
Pulse is looking for files relative to the working directory

Are you refering to a Jupyter notebook we created?

It sounds like `pulse.serialize_from_file` or `pulse.initialize_engine` was not successful

Are you sure you requested MeanArtierialPressure from pulse via a [data request manager](https://gitlab.kitware.com/physiology/engine/-/blob/4.x/src/python/pulse/howto/HowTo_EngineUse.py#L87)?

---

<div class="post-metadata">

**Author:** ![JoseMG98](https://discourse.kitware.com/letter_avatar_proxy/v4/letter/j/c37758/32.png) [@JoseMG98](https://discourse.kitware.com/u/JoseMG98)\
**Post date:** [March 10, 2023, 4:41pm UTC](https://discourse.kitware.com/t/no-module-named-pypulse-error/996/12 "2023-03-10T16:41:59Z")

</div>

Working directory is set to install\bin and works when it is set to this directory, any other directory causes the PyPulse error.

Yes the code was written in the Jupyter notebook that was create. It may be usual to mention the the script written was inside the “HowTo\_EngineUse” Notebook in Jupyter.

MeanArterialPressure was requested with SEDataRequestManager following the required format

---

<div class="post-metadata">

**Author:** ![abray](https://discourse.kitware.com/user_avatar/discourse.kitware.com/abray/32/12_2.png) [@abray](https://discourse.kitware.com/u/abray)\
**Post date:** [March 10, 2023, 5:09pm UTC](https://discourse.kitware.com/t/no-module-named-pypulse-error/996/13 "2023-03-10T17:09:02Z")

</div>

If you want to run from any other working directory, you should add the folder that conatins the PyPulse.pyd file to your PYTHONPATH

You don’t need to do that if you set the working directory to a folder with PyPulse.pyd

---

<div class="post-metadata">

**Author:** ![JoseMG98](https://discourse.kitware.com/letter_avatar_proxy/v4/letter/j/c37758/32.png) [@JoseMG98](https://discourse.kitware.com/u/JoseMG98)\
**Post date:** [March 11, 2023, 9:00pm UTC](https://discourse.kitware.com/t/no-module-named-pypulse-error/996/14 "2023-03-11T21:00:06Z")

</div>

Got it working now! The Jupyter notebook code brought the state from /data/…, there was no /data/ needed in the local Python as that folder didn’t exist. It was copied and pasted over so once the /data/ filepath portion was removed, the initial state was successfully loaded.

---

<div class="post-metadata">

**Author:** ![abray](https://discourse.kitware.com/user_avatar/discourse.kitware.com/abray/32/12_2.png) [@abray](https://discourse.kitware.com/u/abray)\
**Post date:** [March 11, 2023, 11:04pm UTC](https://discourse.kitware.com/t/no-module-named-pypulse-error/996/15 "2023-03-11T23:04:24Z")

</div>

Awesome!

---

<div class="post-metadata">

**Author:** ![striker](https://discourse.kitware.com/letter_avatar_proxy/v4/letter/s/a587f6/32.png) [@striker](https://discourse.kitware.com/u/striker)\
**Post date:** [February 20, 2024, 12:51am UTC](https://discourse.kitware.com/t/no-module-named-pypulse-error/996/16 "2024-02-20T00:51:07Z")

</div>

I have the same error despite reading the documentation following step by step in two different windows 11 pcs, and these posts. Using PyCharm 17.0.9, python 3.11, cmake 3.28.3. I configured the PYTHONPATH and built from source various times with the same results. I am missing files from the build folder as I cannot find any file on install/bin and no python files on Innerbuild. What am I forgetting here? thank you

---

<div class="post-metadata">

**Author:** ![abray](https://discourse.kitware.com/user_avatar/discourse.kitware.com/abray/32/12_2.png) [@abray](https://discourse.kitware.com/u/abray)\
**Post date:** [February 20, 2024, 2:13am UTC](https://discourse.kitware.com/t/no-module-named-pypulse-error/996/17 "2024-02-20T02:13:35Z")

</div>

There are no files in install/bin?  
If there are no files there, there must be a build error.

Do you have a build log?

---

<div class="post-metadata">

**Author:** ![striker](https://discourse.kitware.com/letter_avatar_proxy/v4/letter/s/a587f6/32.png) [@striker](https://discourse.kitware.com/u/striker)\
**Post date:** [February 20, 2024, 12:45pm UTC](https://discourse.kitware.com/t/no-module-named-pypulse-error/996/18 "2024-02-20T12:45:05Z")

</div>

Thank you for your answer. Yes, no files in wither install/bin nor the Innerbuild folders. I am attaching two files for the cmake log  
[CMakeConfigureLog.yaml] ([https://1drv.ms/u/s!AkBJ9jCcyCJhicU3roMdUcivM5HwtA?e=2V85Bk](https://1drv.ms/u/s!AkBJ9jCcyCJhicU3roMdUcivM5HwtA?e=2V85Bk))  
[CMakeCache.txt](https://1drv.ms/t/s!AkBJ9jCcyCJhicU4EShDWNJjQO2xGA?e=vXlQNz)

thank you!

---

<div class="post-metadata">

**Author:** ![abray](https://discourse.kitware.com/user_avatar/discourse.kitware.com/abray/32/12_2.png) [@abray](https://discourse.kitware.com/u/abray)\
**Post date:** [February 20, 2024, 2:28pm UTC](https://discourse.kitware.com/t/no-module-named-pypulse-error/996/19 "2024-02-20T14:28:19Z")

</div>

It looks like you are using `C:/Python312/python.exe`

Can you pipe your build (make command) to a file?

I also have a [4.2 docker container](https://hub.docker.com/r/kitware/pulse) you may want to use instead of building the source code

---

<div class="post-metadata">

**Author:** ![striker](https://discourse.kitware.com/letter_avatar_proxy/v4/letter/s/a587f6/32.png) [@striker](https://discourse.kitware.com/u/striker)\
**Post date:** [February 20, 2024, 5:42pm UTC](https://discourse.kitware.com/t/no-module-named-pypulse-error/996/20 "2024-02-20T17:42:46Z")

</div>

I tried Docker desktop but it doesn’t run. Right after I hit run it stops and shows Exited (0) so I don’t know what I’m doing wrong. I am attaching the result of the two files, one for each command as per the documentation (pipe the build)

[https://1drv.ms/t/s!AkBJ9jCcyCJhicU63dYmkhQFE8ZQ\_Q?e=bINlAC](https://1drv.ms/t/s!AkBJ9jCcyCJhicU63dYmkhQFE8ZQ_Q?e=bINlAC)

[https://1drv.ms/t/s!AkBJ9jCcyCJhicU7lNmwXfLl7GCR0g?e=VHhTsY](https://1drv.ms/t/s!AkBJ9jCcyCJhicU7lNmwXfLl7GCR0g?e=VHhTsY)

Thank you so much for your help,

[Next page](https://discourse.kitware.com/t/no-module-named-pypulse-error/996.md?page=2)
