Google Colab

Hi @solamour & @jacob.small,

Just a question? I was wondering, Is there a way to use Google Colab to link our Dynamo algorithm?

Thank you,

1 Like

Can you provide a bit more insight into what you’re after?

Hi @jacob.small,

there are two reasons:

  1. Some packages like “seaborn” I think it is not recognized by dynamo. (however I might be completely wrong.) I installed seaborn on my computer by using pip and am sure about it. However, when I run dynamo it is giving me a warning message below image:

when I run the same code by using Google Colab it doesn’t give me any error message. I am not sure why it is happening.

after I commented out the line 5, I was trying to run some python code and it is giving me warning message as below image:

image

Again, it is working with Google Colab…

PS: I can share the code with you separately if you need to see the code.

  1. I think this is probably the best of all, I can get the computing power by using Google Colab and I don’t have to have the super computer to handle big amount of data like @RMohareb shared some time ago at the link below. (I hope I did share it correctly)

I would be very appreciated with your input!

Thank you,

1 Like

Are you trying to integrate with an Autodesk application (Revit, C3D, etc.)? That would likely make a huge difference with how you could and should handle your code across multiple platforms.

1 Like

Hi @Nick_Boyts,

This is exactly what I am going after. It would be great if Dynamo team create a hub (a node) that could have a direct link to Google Colab. (just a thought).

1 Like

Hi all,
if we can access colab from dynamo that open a great impact to integrate more packages and features.
@Cezmi your post is not just question it is dream.

1 Like

Hi @RMohareb,

I hope, one day, we can use Google Colab for our algorithms! I agree with you 100% that will create a great impact on our algorithms.

Run a script without a Dynamo / Revit / Civil context (+ the PythonNet bridge) it seems very complicated

This is the understatement of the thread right here. There is a reason multiple teams have

In the context of a sandbox app, you might be able to manage something. But in the context of functional application of the data in your projects? Highly unlikely. A better option would be to look to integrate the toolset in the current context. I haven’t personally looked into the seaborn package mentioned above, but it may just need a particular configuration change or alteration to the import process. Have you confirmed it works in the context of CPython in general (this is becoming more and more of a limitation as we progress further down this road)?

2 Likes

@jacob.small,

yes, it is working in the context of CPython.

Thank you for your response tho and very appreciated!

make sure you pip installed it for the right version of python 3 Cpython in dynamo uses a specific version of python 3

2 Likes

@Cezmi
try to add the site-packages path before import modules

import sys
import clr

clr.AddReference('Python.Included')
import Python.Included as pyInc
path_py3_lib = pyInc.Installer.EmbeddedPythonHome
sys.path.append(path_py3_lib + r'\Lib\site-packages')

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns

OUT = sys.modules
5 Likes

Hi @c.poupin,

Thank you so much! I didn’t know I have to add the site packages path.

1 Like

Hi @timhevel,

So which pip version that needs to be installed?
I thought pip doesn’t matter as long as I could install the package.

Thank you!

I’m not 100% sure but my understanding is 3.8.3 for 2022 (dynamo 2.12) and 3.8.10 for 2023. (dynamo 2.13) (can someone confirm?)
But if you add the the path where seaborn lives manually like @c.poupin described that doesnt matter as much. (I dont fully understand what pyInc does btw)
pip installing with the right version just makes sure it is installed in the the right default folder, that way you probably dont have to add it manually.

@c.poupin 's way is probably better.

3 Likes