Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Nov 27 01:23

    slozier on master

    Fix .NET 6.0 issues (#803) (compare)

  • Nov 27 01:23
    slozier closed #803
  • Nov 27 01:23
    slozier closed #802
  • Nov 26 22:30
    slozier opened #803
  • Nov 26 13:23
    slozier closed #801
  • Nov 26 13:23

    slozier on master

    Remove .NET Core 2.1 (#801) * … (compare)

  • Nov 26 01:57
    slozier unlabeled #1288
  • Nov 26 01:56
    slozier synchronize #801
  • Nov 25 14:00
    slozier commented #802
  • Nov 24 05:43
    JohnTenney commented #802
  • Nov 23 21:28
    slozier commented #802
  • Nov 23 21:19
    slozier labeled #1095
  • Nov 23 21:06
    uffebjorklund commented #802
  • Nov 23 21:06
    uffebjorklund commented #802
  • Nov 23 20:41
    JohnTenney opened #802
  • Nov 22 20:45
    slozier commented #798
  • Nov 22 16:48
    maxmontgmx commented #798
  • Nov 22 16:38
    maxmontgmx commented #798
  • Nov 22 16:38
    maxmontgmx commented #798
  • Nov 20 15:24
    slozier closed #1306
Rob Boehne
@datalogics-robb
this? >>> os.stat(s)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
WindowsError: [Errno 2] [Errno 2] Could not load file or assembly 'Mono.Posix.NETStandard, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.
slozier
@slozier
yes
Rob Boehne
@datalogics-robb
cool thanks, that actually solves some other problems too ;)
Zeeshan Hafeez
@ZeeshannHafeez_twitter

Hi Good People,
I have to run a python script (that contains pandas, numpy, dtw, and other machine learning algorithms) using C sharp. However, I am getting errors: No module named 'pandas', etc.

any solution for this?

6 replies
Daniel Abrahamsson
@danabr
How do I make IronPython find the Python standard library shipped with IronPython.StdLib NuGet package? I'm embedding IronPython in a C# project, and at the moment I have to ship a copy of the standard library along with my binary, and make IronPython find it by giving the path to ScriptEngine.SetSearchPaths. But I would like to avoid bundling the standard library myself. I guess that's the point of IronPython.StdLib? So how do I make use of it?
slozier
@slozier
In theory the StdLib package will output the Lib in your program folder, but you still have to use SetSearchPaths to find it. Personally I find it impractical to distribute something like 500 files so I package it as a zip and distribute that along with my binary. My packaging project looks something like:
<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFrameworks>net46;net472;netcoreapp3.1</TargetFrameworks>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="IronPython" Version="2.7.11" />
    <PackageReference Include="IronPython.StdLib" Version="2.7.11" />
    <PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0">
      <PrivateAssets>all</PrivateAssets>
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
    </PackageReference>
  </ItemGroup>

  <Target Name="BuildPythonCompiler" DependsOnTargets="Build">
    <ItemGroup>
      <StdLibFiles Include="$(OutputPath)Lib\**\*" />
    </ItemGroup>
  </Target>

  <Target Name="BuildStdLib" AfterTargets="Build" DependsOnTargets="BuildPythonCompiler" Inputs="@(StdLibFiles)" Outputs="$(OutputPath)StdLib">
    <Message Text="Creating StdLib" Importance="high" />
    <RemoveDir Directories="$(OutputPath)Lib\ensurepip" />
    <ZipDirectory SourceDirectory="$(OutputPath)Lib" DestinationFile="$(OutputPath)StdLib" Overwrite="true" />
  </Target>

</Project>
Daniel Abrahamsson
@danabr
Thanks! Then I'll start digging into why no Lib seems to be copied to my output folder. Perhaps I just happen to override it.
zeddyhex
@zeddyhex:matrix.org
[m]

I am using IronPython with Unity.
Visual Studio recognizes IronPython, but Unity does not recognize it.

here is the error which I am getting in Unity Console:

slozier
@slozier
do you have the Microsoft.Scripting.dll and Microsoft.Dynamic.dll files in your Scripts folder?
2 replies
zeddyhex
@zeddyhex:matrix.org
[m]
AntsaRan
@AntsaRan
This message was deleted
image.png
Hi everyone! I am using IronPython for the very first time and I tried to use it in a Winform project, so I created My winform project, add ironpython through nugget package manager and then tried to access and run a local script but It always throws " No module named future" error. I've been trying to resolve it for hours now.
27 replies
AntsaRan
@AntsaRan
so here's what i have now
image.png
and the content of the lib
image.png
error :
image.png
Bruce Hoffman
@datalogics-bruceh

I've run into an issue running IronPython in .net core app 3.1 on the Mac. It appears that if an environment variable 'ICU_DATA' is set, it blows up. Any ideas on why?

bruceh@bruceh-mbp-2018 IronPython % dotnet netcoreapp3.1/ipy.dll -X:Frames
IronPython 2.7.11 (2.7.11.1000)
[.NETCoreApp,Version=v3.1 on .NET Core 3.1.6 (64-bit)]
Type "help", "copyright", "credits" or "license" for more information.

exit()
bruceh@bruceh-mbp-2018 IronPython % export ICU_DATA=test
bruceh@bruceh-mbp-2018 IronPython % dotnet netcoreapp3.1/ipy.dll -X:Frames
Unhandled exception. System.Configuration.ConfigurationErrorsException: Configuration system failed to initialize
---> System.TypeInitializationException: The type initializer for 'System.StringComparer' threw an exception.
---> System.Runtime.InteropServices.ExternalException (0x80004005): External component has thrown an exception.
at System.Globalization.CompareInfo.SortHandleCache.GetCachedSortHandle(String sortName)
at System.Globalization.CompareInfo.InitSort(CultureInfo culture)
at System.Globalization.CultureInfo.get_CompareInfo()
at System.StringComparer..cctor()
--- End of inner exception stack trace ---
at System.Configuration.Internal.InternalConfigRoot.GetConfigRecord(String configPath)
at System.Configuration.ClientConfigurationSystem.EnsureInit(String configKey)
--- End of inner exception stack trace ---
at System.Configuration.ClientConfigurationSystem.EnsureInit(String configKey)
at System.Configuration.ClientConfigurationSystem.PrepareClientConfigSystem(String sectionName)
at System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection(String sectionName)
at System.Configuration.ConfigurationManager.GetSection(String sectionName)
at Microsoft.Scripting.Hosting.Configuration.Section.LoadRuntimeSetup(ScriptRuntimeSetup setup, Stream configFileStream)
at Microsoft.Scripting.Hosting.ScriptRuntimeSetup.LoadRuntimeSetupImpl(ScriptRuntimeSetup setup, Stream configFileStream)
at Microsoft.Scripting.Hosting.ScriptRuntimeSetup.LoadRuntimeSetup(ScriptRuntimeSetup setup, Stream configFileStream)
at Microsoft.Scripting.Hosting.ScriptRuntimeSetup.ReadConfiguration()
at Microsoft.Scripting.Hosting.Shell.ConsoleHost.CreateRuntimeSetup()
at PythonConsoleHost.CreateRuntimeSetup()
at Microsoft.Scripting.Hosting.Shell.ConsoleHost.Run(String[] args)
at PythonConsoleHost.Main(String[] args)
zsh: abort dotnet netcoreapp3.1/ipy.dll -X:Frames
bruceh@bruceh-mbp-2018 IronPython %

11 replies
Rob Boehne
@datalogics-robb
Is it possible to put these dependencies in a directory structure that Iron Python would be able to load automatically when it resolves dependencies?
./osx
./osx/Mono.Posix.NETStandard.dll
./osx/libMonoPosixHelper.dylib
./win
./win/System.Drawing.Common.dll
./unix
./unix/Mono.Posix.NETStandard.dll
./unix/System.Drawing.Common.dll
Or would we need to add code to load them manually depending on the platform?
13 replies
AntsaRan
@AntsaRan
hello ! How can I add matplotlib to ironpython?
Gary Lantaff
@g_lantaff_twitter
Visual Studio 2021 does not like IronPython
The environment is never found. Is that due to being 64 bit now?
Gary Lantaff
@g_lantaff_twitter
Any thoughts on a replacement for VS?
slozier
@slozier
I think they completely removed IronPython support. To be fair they also removed Python 2.7 from VS2022...
حسين علي
@alex_ww:matrix.org
[m]
Hello
Can i ask about ironPython for WPF?
1 reply
slozier
@slozier
numpy doesn't work with IronPython (unless maybe you use the old Enthought version)
Sebastian
@biamia_now_twitter
Hey guys,
Does ironpython supports c#.net version 1.9?
6 replies
Since I'm trying to implement fairly old code
WuJieFly
@WuJieFly
hello
Furkan Karayel
@furkankarayel
Will there be any further ironpython version which is going to support c based libraries?
Alex Earl
@slide
It's a lot of work to support C libraries
Matthias Burger
@matthiasburger
hi:) how are things regarding .net 5 and ironpython 3? does it work?
2 replies
Daniel Abrahamsson
@danabr

I am trying to debug a memory leak I have with IronPython. Simplified, my usage looks like this:

try {
  runtime = new ScriptRuntime(setup);
  engine = runtime.GetEngine("py");
  runtime.ExecuteFile(path);
}
finally {
  if (runtime != null) {
    runtime.Shutdown();
  }
   engine = null;
   runtime = null;
}

However, after executing this function (and letting the GC run), a memory profile still shows a lot of references to IronPython.Runtime.PythonDictionary, IronPython.Runtime.PythonContext, Microsoft.Scripting.Interpreter.Interpreter, etc. What more do I need to do to clean up properly?

Daniel Abrahamsson
@danabr
It seems that the leak is due to static fields in DefaultContext keeping references to modules etc alive indefinitely. As far as I can see, there is no way to clean that up.
slozier
@slozier
Hmm, there might be some static resources that could be picked up by doing engine.Execute("import gc; gc.collect()")
Daniel Abrahamsson
@danabr
Thanks, that does help somewhat. There is still some leakage going on. I'll have to keep digging.
Cyril.P
@Cyril-Pop
Hello
i use pyc.exe to compile an app, how can i add 'version' and 'product Name' in the output dll / exe (detail info) ?
my current command
ipyc.exe /main:Program.py MainForm.py ExcelUtils.py /platform:x86 /target:winexe /out:My_App /win32icon:file.ico
Cyril.P
@Cyril-Pop
I will try using signtool
slozier
@slozier
@Cyril-Pop never used ipyc myself, but looking at the code there are command line arguments: /productname: and /fileversion:
ahh, looks like they're documented in the readme but not on the command line /h... https://github.com/IronLanguages/ironpython2/tree/master/Src/IronPythonCompiler#readme
/productversion: