644 questions
-1
votes
1
answer
69
views
Why does C# encounter errors when calling .py files?
Step 1: I have a JlinkHandler.py.
import os
import platform
import pylink
from pylink import Library
def __init__(self):
# 获取当前脚本所在目录
base_dir = os.path.dirname(__file__)
# 判断 Python 位数
...
2
votes
1
answer
117
views
How to iterate over python dictionary in C#
I am trying to call a C# logging library from Python. I want to support logging complex Python objects and dictionaries from the C# library. I'm using pythonnet 3.0.5.
When I pass the dictionary to ...
0
votes
1
answer
74
views
Why does my pythonnet not load the correct dependency when loading DLL:s via reflection
I'm writing a Python application that uses clr 3.0.3.
I'm trying to load a DLL using System.Reflection.Assembly.LoadFrom. My code is basically doing the following:
def load_from(dll_paths):
for ...
1
vote
1
answer
39
views
EPOS4: VcsGetPositionIs and VcsGetVelocityIs always return 0 when called from pythonnet
I'm trying to read position and velocity values from 4 Maxon EPOS4 50/5 motor controllers using Python with pythonnet (.NET wrapper). I have them connected via Gateway (RS232 + CAN). While I can ...
0
votes
1
answer
375
views
How to connect to Power BI XMLA Endpoint using InteractiveBrowserCredential in python?
I am trying a approach to use the token generated using InteractiveBrowserCredential to connect to Power BI XMLA Endpoint. I was able to connect to the model using pyadomd locally but the same won't ...
0
votes
0
answers
61
views
AddReference Method in CLR - PythonNet is not found
Trying to add System assembly in a python code:
clr.AddReference(assembly_name)
where assembly name is Sytem, but in this **AddReference ** is attribute is not found under clr. Also in PythonNet clr ...
1
vote
0
answers
58
views
Calling windows-targeted .NET dll using pythonnet
I'm trying to call my C# library from python like so:
import sys
import clr
dll_path = r"/path/to/dll/folder"
sys.path.append(dll_path)
clr.AddReference("PyCsLib") # <- ...
0
votes
1
answer
462
views
Docling running inside .NET 8 web application crash
I created a NEt web application which does call a python function from C# via pythonnet (v 3.0.5)
I can't figureout why it crashes. Any help will be appreciated.
private async Task<string> ...
0
votes
0
answers
48
views
Cannot load an EF Core db context wrapper in Python using Python.NET
Crossposting from here
I have a class called ModelSetWrapper which wraps model sets from an EfCore DbContext (Jet, specifically) and returns a dictionary containing the model set information. Here's ...
0
votes
0
answers
79
views
Why won't the C# .NET DLL import?
Here is my code:
import clr
clr.AddReference("PixelPilot.Core")
from PixelPilot.Core import *
I have already tried renaming the DLL and also trying different names to import it. (EX. ...
0
votes
0
answers
76
views
Pythonnet (.Net in Python): Failed to initialize Python.Runtime dll
I'm trying to to load a dll from Python. To be more exact, I have Python 3.9.18 bundled with ArcGIS Pro. Default environemnt doesn't have pythonnet installed and it doesn't allow to install new ...
0
votes
1
answer
233
views
How to Call Python Code from Blazor WebApp
I am trying to run a python script from a Blazor WebApp using pythonnet. The python script is located in the project but the PyModule.Import call to the script throws an error saying the module can't ...
1
vote
1
answer
107
views
Unity + Pythonnet: Interpreter preserves state between plays, and only resets when the unity editor closes
I am trying to integrate python into my unity project using the nuget package pythonnet.
I set my python lifecycle the same way it was set in this git project:
https://github.com/shiena/Unity-...
3
votes
2
answers
111
views
Problem with Python module imports in Unity using Pythonnet
I’m using pythonnet in Unity to integrate Python. Loading Python modules takes some time on the first run in the release version, which is why I used an asynchronous approach with Task and ...
1
vote
1
answer
188
views
Stack Overflow running Python using pythonnet on .Net
I'm trying to run my Python script with LangChain on .NET using PythonNet and Python.Runtime, but I keep encountering an overflow error.
Issue:
The overflow occurs at different locations depending on ...