# How to install Python modules in Dynamo Core Runtime 2.8.0?

**URL:** <https://forum.dynamobim.com/t/how-to-install-python-modules-in-dynamo-core-runtime-2-8-0/52922>\
**Category:** Developers\
**Tags:** python, cpython3\
**Created:** [July 13, 2020, 5:43pm UTC](https://forum.dynamobim.com/t/how-to-install-python-modules-in-dynamo-core-runtime-2-8-0/52922 "2020-07-13T17:43:27Z")\
**Posts on this page:** 11\
**Page:** 5

<div class="post-metadata">

**Author:** ![Hadi.Moosavi](https://avatars.discourse-cdn.com/v4/letter/h/fbc32d/32.png) [@Hadi.Moosavi](https://forum.dynamobim.com/u/Hadi.Moosavi)\
**Post date:** [July 15, 2024, 10:31pm UTC](https://forum.dynamobim.com/t/how-to-install-python-modules-in-dynamo-core-runtime-2-8-0/52922/82 "2024-07-15T22:31:27Z")

</div>

By the way, are all these explained methods for Dynamo Sandbox or will they also work for Revit Dynamo?

---

<div class="post-metadata">

**Author:** ![Mike.Buttery](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@Mike.Buttery](https://forum.dynamobim.com/u/Mike.Buttery)\
**Post date:** [July 16, 2024, 12:13am UTC](https://forum.dynamobim.com/t/how-to-install-python-modules-in-dynamo-core-runtime-2-8-0/52922/83 "2024-07-16T00:13:00Z")

</div>

> [@Hadi.Moosavi](#):
>
> I think it automatically chose a version that is compatible with python 3.9

The current version is compatible with 3.9

> [@Hadi.Moosavi](#):
>
> will they also work for Revit Dynamo

Yes

Have you changed the ` __init__.py` file in the `openseespywin` folder?  
Have you added the path to TCL?

If you are getting an error, upload a screenshot with the error expanded so it may be possible to diagnose any issues

---

<div class="post-metadata">

**Author:** ![Hadi.Moosavi](https://avatars.discourse-cdn.com/v4/letter/h/fbc32d/32.png) [@Hadi.Moosavi](https://forum.dynamobim.com/u/Hadi.Moosavi)\
**Post date:** [July 16, 2024, 5:06am UTC](https://forum.dynamobim.com/t/how-to-install-python-modules-in-dynamo-core-runtime-2-8-0/52922/84 "2024-07-16T05:06:40Z")

</div>

Thank you Mike for looking into this. Please see below:

- installing openseespy: it is installed. see below.  

- tcl is installed. (I don’t understand why we need to install this. but I did. see below)  

- I changed line 14 from “if ‘DLLs’ in path:” to “if ‘Tcl86’ in path:”. see below:  

- here is the python script and the error I get in Revit Dynamo

---

<div class="post-metadata">

**Author:** ![Mike.Buttery](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@Mike.Buttery](https://forum.dynamobim.com/u/Mike.Buttery)\
**Post date:** [July 16, 2024, 5:20am UTC](https://forum.dynamobim.com/t/how-to-install-python-modules-in-dynamo-core-runtime-2-8-0/52922/85 "2024-07-16T05:20:29Z")

</div>

What is the error when you try this code

```python
import sys

from pathlib import Path
sys.path.append(str(Path.home().joinpath("AppData\\Local\\Apps\\Tcl86\\bin")))

import openseespywin

```

---

<div class="post-metadata">

**Author:** ![Hadi.Moosavi](https://avatars.discourse-cdn.com/v4/letter/h/fbc32d/32.png) [@Hadi.Moosavi](https://forum.dynamobim.com/u/Hadi.Moosavi)\
**Post date:** [July 16, 2024, 1:41pm UTC](https://forum.dynamobim.com/t/how-to-install-python-modules-in-dynamo-core-runtime-2-8-0/52922/86 "2024-07-16T13:41:49Z")

</div>

> [@Mike.Buttery](#):
>
> `import openseespywin`

Strangely, I get this.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/a/f/af2e7d5dded8827986a1d5e03e07cad9e08a2ee3.png)

---

<div class="post-metadata">

**Author:** ![Hadi.Moosavi](https://avatars.discourse-cdn.com/v4/letter/h/fbc32d/32.png) [@Hadi.Moosavi](https://forum.dynamobim.com/u/Hadi.Moosavi)\
**Post date:** [July 16, 2024, 2:04pm UTC](https://forum.dynamobim.com/t/how-to-install-python-modules-in-dynamo-core-runtime-2-8-0/52922/87 "2024-07-16T14:04:05Z")

</div>

Solved with appending the address to the package location.  
I don’t know why it was not looking at that location. ☹  
Thank you for all the help, Mike!

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/d/f/df7cbd0803a7127dae407a05251880a95ae47673.png)

---

<div class="post-metadata">

**Author:** ![Mike.Buttery](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@Mike.Buttery](https://forum.dynamobim.com/u/Mike.Buttery)\
**Post date:** [July 17, 2024, 12:46am UTC](https://forum.dynamobim.com/t/how-to-install-python-modules-in-dynamo-core-runtime-2-8-0/52922/88 "2024-07-17T00:46:10Z")

</div>

You can add the library path so that it is not hard coded as follows

```python
import sys
import sysconfig
# ...
# site-package library paths
sys.path.append(sysconfig.get_path("platlib"))

```

---

<div class="post-metadata">

**Author:** ![Hadi.Moosavi](https://avatars.discourse-cdn.com/v4/letter/h/fbc32d/32.png) [@Hadi.Moosavi](https://forum.dynamobim.com/u/Hadi.Moosavi)\
**Post date:** [August 16, 2024, 9:09pm UTC](https://forum.dynamobim.com/t/how-to-install-python-modules-in-dynamo-core-runtime-2-8-0/52922/89 "2024-08-16T21:09:44Z")

</div>

So I have been using the openseespy successfully for a few cases. Now I am trying to see if I can use some visualization packages. I am looking at opsvis [Welcome to Opsvis documentation! — opsvis 0.99.1 documentation](https://opsvis.readthedocs.io/en/latest/index.html)  
@Mike.Buttery just checking if you have tried this or anything similar to it. I successfully used it in a normal pyhton file but in Dynamo the plot does not show up. It does not give any errors though.

---

<div class="post-metadata">

**Author:** ![e.j.nap](https://avatars.discourse-cdn.com/v4/letter/e/ecc23a/32.png) [@e.j.nap](https://forum.dynamobim.com/u/e.j.nap)\
**Post date:** [January 4, 2025, 10:00am UTC](https://forum.dynamobim.com/t/how-to-install-python-modules-in-dynamo-core-runtime-2-8-0/52922/90 "2025-01-04T10:00:50Z")

</div>

The neatest trick I’ve seen to getting Matplotlib to show anything in Dynamo is to have it create a bitmap stream. This you can feed to the Dynamo Watch Image Node.  
[Python 3 Skelitonization - plt.show() not work - Developers - Dynamo](https://forum.dynamobim.com/t/python-3-skelitonization-plt-show-not-work/63216/7)

---

<div class="post-metadata">

**Author:** ![e.j.nap](https://avatars.discourse-cdn.com/v4/letter/e/ecc23a/32.png) [@e.j.nap](https://forum.dynamobim.com/u/e.j.nap)\
**Post date:** [January 4, 2025, 10:17am UTC](https://forum.dynamobim.com/t/how-to-install-python-modules-in-dynamo-core-runtime-2-8-0/52922/91 "2025-01-04T10:17:41Z")

</div>

It looks like the path only needs to be added once, at least per user. I needed this code in Dynamo Sandbox 2.19 with Python 3.9.12 to get the shapely package to be found. Then ran Revit with the same Python version and ‘import shapely’ worked instantly.

---

<div class="post-metadata">

**Author:** ![trygve.wastvedt](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/trygve.wastvedt/32/184786_2.png) [@trygve.wastvedt](https://forum.dynamobim.com/u/trygve.wastvedt)\
**Post date:** [February 5, 2025, 5:08pm UTC](https://forum.dynamobim.com/t/how-to-install-python-modules-in-dynamo-core-runtime-2-8-0/52922/92 "2025-02-05T17:08:38Z")

</div>

Thanks to the discussion here we were able to identify a bug in Dynamo around that missing site-packages path. Should be fixed in the next release! (or now in a daily build if you’re adventurous) It’s also fixed in the new PythonNet3 Python engine available on the package manager for Dynamo 3.3+.

[Previous page](https://forum.dynamobim.com/t/how-to-install-python-modules-in-dynamo-core-runtime-2-8-0/52922.md?page=4)
