# 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:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Khasan\_Mamaev](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/khasan_mamaev/32/19511_2.png) [@Khasan\_Mamaev](https://forum.dynamobim.com/u/Khasan_Mamaev)\
**Post date:** [July 13, 2020, 5:43pm UTC](https://forum.dynamobim.com/t/how-to-install-python-modules-in-dynamo-core-runtime-2-8-0/52922/1 "2020-07-13T17:43:27Z")

</div>

How to install Python modules in Dynamo Core Runtime 2.8.0 ?

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [July 13, 2020, 6:46pm UTC](https://forum.dynamobim.com/t/how-to-install-python-modules-in-dynamo-core-runtime-2-8-0/52922/2 "2020-07-13T18:46:48Z")

</div>

Just need to import them as you would all the way back in Dynamo 2.0 (and likely before that too).

ie: `import clr`, which imports the common language runtime into Dynamo’s Python integration. This presentation has a good breakdown: [dynamoPython/DivingDeeper\_ABeginnersLookAtPythonInDynamo\_AU\_London2018.pdf at master · Amoursol/dynamoPython · GitHub](https://github.com/Amoursol/dynamoPython/blob/master/images/DivingDeeper_ABeginnersLookAtPythonInDynamo_AU_London2018.pdf)

Another slightly more complex example from [this thread](https://forum.dynamobim.com/t/calling-ctypes-to-create-a-custom-system-message/9357/2):

```
import sys
sys.path.append(r'C:\Program Files (x86)\IronPython 2.7\Lib')
import ctypes

```

which adds the ctypes library to the associated Python node.

---

<div class="post-metadata">

**Author:** ![Khasan\_Mamaev](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/khasan_mamaev/32/19511_2.png) [@Khasan\_Mamaev](https://forum.dynamobim.com/u/Khasan_Mamaev)\
**Post date:** [July 13, 2020, 6:54pm UTC](https://forum.dynamobim.com/t/how-to-install-python-modules-in-dynamo-core-runtime-2-8-0/52922/3 "2020-07-13T18:54:34Z")

</div>

No IronPython) Dynamo Core Runtime 2.8.0 have a normaly Python 3.8

---

<div class="post-metadata">

**Author:** ![solamour](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/solamour/32/153516_2.png) [@solamour](https://forum.dynamobim.com/u/solamour)\
**Post date:** [July 13, 2020, 7:03pm UTC](https://forum.dynamobim.com/t/how-to-install-python-modules-in-dynamo-core-runtime-2-8-0/52922/4 "2020-07-13T19:03:18Z")

</div>

Hello @Khasan_Mamaev - the Daily Builds as of today have access to different `Python Engines` as follows, but still use `IronPython2` as the default - which has historically been in Dynamo 🙂

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

Or;

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

---

<div class="post-metadata">

**Author:** ![Khasan\_Mamaev](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/khasan_mamaev/32/19511_2.png) [@Khasan\_Mamaev](https://forum.dynamobim.com/u/Khasan_Mamaev)\
**Post date:** [July 13, 2020, 7:40pm UTC](https://forum.dynamobim.com/t/how-to-install-python-modules-in-dynamo-core-runtime-2-8-0/52922/5 "2020-07-13T19:40:13Z")

</div>

![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/3/2/3216c280dae740924f39b7182e24bc510774ef88.png)

---

<div class="post-metadata">

**Author:** ![solamour](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/solamour/32/153516_2.png) [@solamour](https://forum.dynamobim.com/u/solamour)\
**Post date:** [July 13, 2020, 8:33pm UTC](https://forum.dynamobim.com/t/how-to-install-python-modules-in-dynamo-core-runtime-2-8-0/52922/6 "2020-07-13T20:33:30Z")

</div>

We have a `task to explore how we want to support this` and will be writing a `blog post afterwards`, but as of right now we do not have an officially supported way 🙂

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [July 13, 2020, 9:14pm UTC](https://forum.dynamobim.com/t/how-to-install-python-modules-in-dynamo-core-runtime-2-8-0/52922/7 "2020-07-13T21:14:17Z")

</div>

Downloading locally in advance and importing the package via the by directory should work for the time being, right?

---

<div class="post-metadata">

**Author:** ![solamour](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/solamour/32/153516_2.png) [@solamour](https://forum.dynamobim.com/u/solamour)\
**Post date:** [July 16, 2020, 9:26pm UTC](https://forum.dynamobim.com/t/how-to-install-python-modules-in-dynamo-core-runtime-2-8-0/52922/8 "2020-07-16T21:26:13Z")

</div>

Hello @Khasan_Mamaev, while we are still working on an Officially supported way, here is how you can access these libraries today in Dynamo 2.7/2.8 as a workaround:

Note: Please make sure you are comfortable doing the following steps and make sure you read all of the Terms and Conditions 🙏

Steps:

1. Download `Anaconda` - [https://www.anaconda.com/products/individual](https://www.anaconda.com/products/individual)
2. After install, select the `CMD.exe Prompt` from the **Home** tab in the _Anaconda Navigator_ (Install if you need to).  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/f/8/f8d3d225cde6b175f36f10e019a5aedf6c673add.png)
3. This will open up the Command prompt `in` your **(base)** directory as Anaconda creates localized environments.
4. Open up Dynamo 2.7 (or newer) and query the CPython version - as shown below (Note: Make sure you are in the CPython3 engine)

```auto
import sys

OUT = sys.version
```

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/0/b/0bee869f1eaf5084edef701b15a474b9995e05a6.jpeg)  
5. Go back to the _Anaconda Command Prompt_ and create a `new environment` that uses the correct version of Python - In my case version 3.7.3. I’ve called this environment `Dynamo373` and you use the following code to create it:

```auto
 conda create --name Dynamo373 python=3.7.3
```

1. You then want to activate this environment, and do so by typing the following code directly into your _Anaconda Command Prompt_:

```auto
 conda activate Dynamo373 
```

1. You can then use `Pip` to install to this particular environment with:

```auto
 pip install numpy 
```

Note you can install other packages here, like Pandas or Keras etc.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/a/f/af1841412179d4ff95cce5a0d2875872dd4fa619.png)  
8. Inside this _Anacondas Command Prompt_ you will select the location path where they are being installed to your environment: In my case `c:\users\amours\anaconda3\envs\dynamo373\lib\site-packages `  
9. Back in Dynamo you will open up a new Python node, set it’s `engine` to **CPython3** and then append this path to your `sys.path` location.  
10. Then you can simply import all of your desired libraries 🙂  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/8/9/8927b556ca85eb446db3d079fce45ccb67b87a0c.png)

```auto
# Load the Python Standard and DesignScript Libraries
import sys
import clr

sys.path.append(r'C:\Users\amours\anaconda3\envs\Dynamo373\Lib\site-packages')
import numpy

zeros = numpy.zeros(5)
output = zeros.tolist()

OUT = output
```

---

<div class="post-metadata">

**Author:** ![Jimmy1](https://avatars.discourse-cdn.com/v4/letter/j/ea666f/32.png) [@Jimmy1](https://forum.dynamobim.com/u/Jimmy1)\
**Post date:** [July 17, 2020, 2:45am UTC](https://forum.dynamobim.com/t/how-to-install-python-modules-in-dynamo-core-runtime-2-8-0/52922/9 "2020-07-17T02:45:38Z")

</div>

This is great, but why it only works when using “pip install”, and warning errors using “conda install” ?

---

<div class="post-metadata">

**Author:** ![solamour](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/solamour/32/153516_2.png) [@solamour](https://forum.dynamobim.com/u/solamour)\
**Post date:** [July 17, 2020, 1:14pm UTC](https://forum.dynamobim.com/t/how-to-install-python-modules-in-dynamo-core-runtime-2-8-0/52922/10 "2020-07-17T13:14:41Z")

</div>

I’m unsure sorry @Jimmy1 - would have look into Anaconda itself 🙂

---

<div class="post-metadata">

**Author:** ![lenowak](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/lenowak/32/99194_2.png) [@lenowak](https://forum.dynamobim.com/u/lenowak)\
**Post date:** [July 29, 2020, 7:26am UTC](https://forum.dynamobim.com/t/how-to-install-python-modules-in-dynamo-core-runtime-2-8-0/52922/11 "2020-07-29T07:26:46Z")

</div>

Works perfect!!! Thanks!!! 🙂

---

<div class="post-metadata">

**Author:** ![solamour](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/solamour/32/153516_2.png) [@solamour](https://forum.dynamobim.com/u/solamour)\
**Post date:** [August 4, 2020, 9:38pm UTC](https://forum.dynamobim.com/t/how-to-install-python-modules-in-dynamo-core-runtime-2-8-0/52922/12 "2020-08-04T21:38:04Z")

</div>

Pinned on August 4, 2020, 9:38pm UTC



---

<div class="post-metadata">

**Author:** ![Eric5](https://avatars.discourse-cdn.com/v4/letter/e/7feea3/32.png) [@Eric5](https://forum.dynamobim.com/u/Eric5)\
**Post date:** [August 21, 2020, 8:45am UTC](https://forum.dynamobim.com/t/how-to-install-python-modules-in-dynamo-core-runtime-2-8-0/52922/13 "2020-08-21T08:45:43Z")

</div>

Good job! Thanks ! I have done it as you showed . If there is someone who don’t need the whole Anaconda , he can install only numpy . of course , he must add the path of the numpy into sys.path instead of the path of Anaconda .

---

<div class="post-metadata">

**Author:** ![solamour](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/solamour/32/153516_2.png) [@solamour](https://forum.dynamobim.com/u/solamour)\
**Post date:** [August 21, 2020, 1:58pm UTC](https://forum.dynamobim.com/t/how-to-install-python-modules-in-dynamo-core-runtime-2-8-0/52922/14 "2020-08-21T13:58:11Z")

</div>

Hi @Eric5!

Indeed there is - this was a workaround until we published a new method, of which we did a day or so ago - you can access it here: [https://github.com/DynamoDS/Dynamo/wiki/Customizing-Dynamo’s-Python-3-installation](https://github.com/DynamoDS/Dynamo/wiki/Customizing-Dynamo's-Python-3-installation) 🙂

---

<div class="post-metadata">

**Author:** ![ncv239spb](https://avatars.discourse-cdn.com/v4/letter/n/977dab/32.png) [@ncv239spb](https://forum.dynamobim.com/u/ncv239spb)\
**Post date:** [May 13, 2021, 3:14pm UTC](https://forum.dynamobim.com/t/how-to-install-python-modules-in-dynamo-core-runtime-2-8-0/52922/15 "2021-05-13T15:14:23Z")

</div>

@solamour Hi, I followed the steps described [here](https://github.com/DynamoDS/Dynamo/wiki/Customizing-Dynamo%E2%80%99s-Python-3-installation) and successfully installed 3rd party pathon-modules. I can import them, if running python in the described directory.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/8/688c2a32f65998a1592bd1d44898808b27aa5d2e.png)

Unfortunately I cannot import installed python-libraries in Dynamo (ModuleNotFoundError)  
The command `os. __file__ ` in the Python-Code-Node within Dynamo gives the following output:  
“C:\Users\NCV\AppData\Local\python-3.8.3-embed-amd64\python38.zip\os.pyc”

Using DynamoCore 2.11.1.4675

What could have gone wrong?

---

<div class="post-metadata">

**Author:** ![solamour](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/solamour/32/153516_2.png) [@solamour](https://forum.dynamobim.com/u/solamour)\
**Post date:** [May 17, 2021, 3:19pm UTC](https://forum.dynamobim.com/t/how-to-install-python-modules-in-dynamo-core-runtime-2-8-0/52922/16 "2021-05-17T15:19:57Z")

</div>

Hello @ncv239spb - It sounds like you may have missed a step along the way 😊

Can you please see if you have the following on your set-up?

1. In `C:\Users\<yourUsername>\AppData\Local\python-3.8.3-embed-amd64\Scripts` you can see a reference to `pip`  

2. In `C:\Users\<yourUsername>\AppData\Local\python-3.8.3-embed-amd64\Lib\site-packages` you can see all your Python 3 libraries installed - i.e. **Numpy**.  

3. In the **python38.\_pth** file in `C:\Users\<yourUsername>\AppData\Local\python-3.8.3-embed-amd64` yours looks like mine - as below:  

Hopefully there is something to amend here to unblock you!

---

<div class="post-metadata">

**Author:** ![iliaspitserov](https://avatars.discourse-cdn.com/v4/letter/i/e19b73/32.png) [@iliaspitserov](https://forum.dynamobim.com/u/iliaspitserov)\
**Post date:** [May 25, 2021, 5:06pm UTC](https://forum.dynamobim.com/t/how-to-install-python-modules-in-dynamo-core-runtime-2-8-0/52922/17 "2021-05-25T17:06:50Z")

</div>

Hi Sol!  
Looks like I’m running into a similar problem with Sandbox 2.11.1  
Can’t import the libraries into the python script, though I followed the guide meticulously.  
Here are some screenshots showing the up to date status of the relevant folders.

The easy\_install modules are not there, for some reason, but all the libraries are installed successfully in the 3.8.3 site-packages folder. Still, the import gives me an error in Dynamo.

Would appreciate your help!  
Ilia

 ![pip_3](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/f/2/f2cb141dcd29274a8d5750a6cc8d333eae3792a3.jpeg)  
 ![pip-1](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/4/d/4df2853e6c65ca54f791ea73092e6659757087c1.jpeg)  
 ![pip-2](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/2/9/2915800665b1bfad71546fa464524680d78720af.jpeg)  
 ![pip-4](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/c/7/c714430b0917823607ac3d1510f63760f4cb8b8c.jpeg)

---

<div class="post-metadata">

**Author:** ![c.poupin](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/c.poupin/32/89152_2.png) [@c.poupin](https://forum.dynamobim.com/u/c.poupin)\
**Post date:** [May 25, 2021, 5:13pm UTC](https://forum.dynamobim.com/t/how-to-install-python-modules-in-dynamo-core-runtime-2-8-0/52922/18 "2021-05-25T17:13:29Z")

</div>

Hello  
try to add the path

```
import sys
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

sys.path.append(r'C:\Users\USERNAME\AppData\Local\python-3.8.3-embed-amd64\Lib\site-packages')
import numpy as np
```

---

<div class="post-metadata">

**Author:** ![iliaspitserov](https://avatars.discourse-cdn.com/v4/letter/i/e19b73/32.png) [@iliaspitserov](https://forum.dynamobim.com/u/iliaspitserov)\
**Post date:** [May 25, 2021, 5:19pm UTC](https://forum.dynamobim.com/t/how-to-install-python-modules-in-dynamo-core-runtime-2-8-0/52922/19 "2021-05-25T17:19:59Z")

</div>

> [@c.poupin](#):
>
> `sys.path.append(r'C:\Users\USERNAME\AppData\Local\python-3.8.3-embed-amd64\Lib\site-packages')`

Thanks! It worked.  
Frankly, I think this solution should be added to the python 3 customization guide.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/3/2/323309eaf9a0781480482739a772f222b3ad4e04.jpeg)

---

<div class="post-metadata">

**Author:** ![solamour](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/solamour/32/153516_2.png) [@solamour](https://forum.dynamobim.com/u/solamour)\
**Post date:** [May 25, 2021, 5:27pm UTC](https://forum.dynamobim.com/t/how-to-install-python-modules-in-dynamo-core-runtime-2-8-0/52922/20 "2021-05-25T17:27:36Z")

</div>

Consider it added 😃

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

> **[DynamoDS/Dynamo](https://github.com/DynamoDS/Dynamo/wiki/Customizing-Dynamo's-Python-3-installation)**
>
> Customizing-Dynamo's-Python-3-installation

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