4,103 questions
C # uses python net technology, and cannot run programs on other PC after packaging
再辰 王
0
Reputation points
The program can run on my computer, and the packaged program needs to add a Python package under the. exe path to run.
When I run the packaged. exe on another computer, I can't succeed in any way.
I have changed to a relative path and read python38.dll. I don't know why it failed.
public Form1()
{
try
{
// Runtime.PythonDLL = Path.Combine(Environment.GetFolderPath( //Environment.SpecialFolder.LocalApplicationData),
//str + @"\Python\python38.dll");
Runtime.PythonDLL = Environment.CurrentDirectory + @"\Python\python38.dll"; InitializeComponent();
PythonEngine.Initialize();
PythonEngine.BeginAllowThreads();
}catch(Exception e)
{
throw;
}
}
Developer technologies .NET Other
Developer technologies C#
11,567 questions
Sign in to answer