Python Reference paths


#1

Hello Community,

I’m finding a lot of this in many python code boilertplates:

<span style="color: #454545;">path = r</span><span style="color: #454545;">'C:\Autodesk\Dynamo\Core'</span><br style="color: #454545;" /><span style="color: #454545;">exec_path = r</span><span style="color: #454545;">'C:\Autodesk\Dynamo\Core\dll'</span><br style="color: #454545;" /><span style="color: #454545;">sys.path.</span><span style="color: #454545;">append</span><span style="color: #454545;">(path)</span><br style="color: #454545;" /><span style="color: #454545;">sys.path.</span><span style="color: #454545;">append</span><span style="color: #454545;">(exec_path)</span><br style="color: #454545;" /><span style="color: #454545;">clr.</span><span style="color: #454545;">AddReference</span><span style="color: #454545;">(</span><span style="color: #454545;">'LibGNet'</span><span style="color: #454545;">)</span><br style="color: #454545;" /><span style="color: #454545;">from</span><span style="color: #454545;"> Autodesk.LibG </span><span style="color: #454545;">import</span><span style="color: #454545;"> *</span>
My problem is that this directory does not exist and I'm wondering if I'm missing something in my install to place some python modules at these locations. I have found that C:\Program Files\Dynamo 0.8 exists along directories to the various libg library versions. Do I need to redirect my path variables to this location?

Thanks,


#2

I apologize, I tried editing the code several times to avoid the formatting. i’m not sure why it’s doing that.

The directories in question are:

path = r’C:\Autodesk\Dynamo\Core’
exec_path = r’C:\Autodesk\Dynamo\Core\dll’


#3

what python code are you finding those references in? It’s probably quite out of date, that is where dynamo used to reside in version .6…

It’s now in ProgramFiles,

But The core has probably changed enough that whatever reference the python was using my no longer exist. Would be interested to see what code it is.


#4

Thanks, Michael. That is what I was thinking. I’m finding it in some definitions from early 2014. I did a lot of reading on the changes betwen v6 and v7 in referencing API. I just needed some confirmation on what I was seeing.

Thanks for the response!