Skip to content

IronPython.StdLib is not loaded in Dynamo3+ #17

@Cyril-Pop

Description

@Cyril-Pop

Hi,

Dynamo version

DynamoSanbox 3.4.1

IronPython version

2.7

DynamoIronPython2 Package version

3.2.1

Operating system

Win 10

What did you expect to see?

IronPython.StdLib is not loaded by default

Image

code to reproduce

import sys
import clr
try:
    import functools
except Exception as e:
    OUT = e, sys.version, sys.path

workaround adding the correct StdLib path in sys.path

     
import sys
import clr
import System
clr.AddReference("System.Core")
clr.ImportExtensions(System.Linq)
#
ipy2_assembly = System.AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault(lambda a : a.GetName().Name == 'IronPython.Modules')
assembly_ipy2_Directory = System.IO.Path.GetDirectoryName( ipy2_assembly.Location )
parent_ipy2_Directory = System.IO.Directory.GetParent(assembly_ipy2_Directory).FullName
#
if System.IO.Directory.Exists(parent_ipy2_Directory + "\\lib"):
	sys.path.append(parent_ipy3_Directory + "\\lib")
if System.IO.Directory.Exists(parent_ipy2_Directory + "\\extra\\lib"):
	sys.path.append(parent_ipy2_Directory + "\\extra\\lib")
if System.IO.Directory.Exists(parent_ipy2_Directory + "\\extra"):
	sys.path.append(parent_ipy2_Directory + "\\extra")
    
import functools
import io                                             

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions