cannot create weak reference to 'classobj' object

I am trying to run the python Script in a C# program using Iron Python I am getting this type of Error

cannot create weak reference to 'classobj' object

I am using this code for running the python code

var ironPythonRuntime = Python.CreateRuntime();
 try
{

dynamic loadPython = ironPythonRuntime.UseFile("Program.py");

}
catch (Exception ex)
{
    Console.WriteLine(ex.Message);
}


March 31st, 2015 5:13am

hi,

try this article:> https://pypi.python.org/pypi/virtualenv

Free Windows Admin Tool Kit Click here and download it now
March 31st, 2015 5:41am

hi,

I am not able find the solution for this using the link that you have provided

March 31st, 2015 6:25am

Hi Mahesh,

About IronPython issue, It's third-party product.  Please redirect to IronPython forum.  The link as below.

https://ironpython.codeplex.com/workitem/list/basic

After search this error, this thread tells me.

Try to use virtualenv. It is used to separate many instances of python and it's libraries - you can have as many virtual environments as possible: python 2.5 , 2.6 , 2.7, whatever - with any combinations of libraries - so you can have for example five python 2.6 instances with different sets of libraries configured.

By the way, here is also a blog talking about Running IronPython Scripts from a C# 4.0 Program

Now I will move your thread to "off-topic" forum. Thanks for your understanding.

Best regards,

Kristin

Free Windows Admin Tool Kit Click here and download it now
April 1st, 2015 3:10am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics