Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visbrain in Pythonnet #22

Closed
STREETKILLER007 opened this issue Aug 12, 2018 · 8 comments
Closed

Visbrain in Pythonnet #22

STREETKILLER007 opened this issue Aug 12, 2018 · 8 comments
Labels

Comments

@STREETKILLER007
Copy link

Is it possible to run Visbrain in Pythonnet that support up to python 3.5 environment ?

@EtienneCmb
Copy link
Owner

GitMate.io thinks possibly related issues are #21 (Visbrain in IronPython), #4 (installing visbrain), #10 (Update and/or redirect links to visbrain modules), and #17 (Hello I cant open visbrain everytime i get same error ).

@EtienneCmb
Copy link
Owner

I've never test Pythonnet you'll be the first one as far as I know :)

@STREETKILLER007
Copy link
Author

Ok, gonna try it~
Any error issue, will try to update here.

@STREETKILLER007
Copy link
Author

ERROR

Environment

  1. Pythonnet version: v2.3.0

11

i downloaded this from "Manage Nuget-Package" in Visual Studio 2017 Community

  1. Python version: Python 3.6.5 (Amaconda 3)

Already pip install pythonnet in the environment.

  1. Operating System: Window 7, 64 bit

  2. Software Used : Microsoft Visual Studio Community 2017

4.1) .net framework : 4

  1. python version from cmd

111

  1. where python from cmd

112

  1. path includes

M:\Anaconda3;M:\Anaconda3\Library\mingww64\bin;M:\Anaconda3\Library\usr\bin;M:\Anaconda3\Library\bin;M:\Anaconda3\Scripts

Details

To do : Trying to implement Python in c# form

Progress :

running this code.

private static void button_Click(object sender, EventArgs e)
{
    using (Py.GIL())   
    {
         dynamic myVisbrain = Py.Import("Visbrain"); 
    }
}

when debug,

from program.cs

Application.Run(new Form1()); // crashes here

error message :

Exception thrown: 'System.BadImageFormatException' in System.Windows.Forms.dll
An unhandled exception of type 'System.BadImageFormatException' occurred in System.Windows.Forms.dll
Could not load file or assembly 'Python.Runtime, Version=2.3.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.

stack trace :

System.BadImageFormatException
  HResult=0x8007000B
  Message=Could not load file or assembly 'Python.Runtime, Version=2.3.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.
  Source=WindowsFormsAppJTTH
  StackTrace:
   at WindowsFormsAppJTTH.Form1.button1_Click(Object sender, EventArgs e) in C:\Users\Administrator\source\repos\WindowsFormsAppJTTH\WindowsFormsAppJTTH\Form1.cs:line 219
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at WindowsFormsAppJTTH.Program.Main() in C:\Users\Administrator\source\repos\WindowsFormsAppJTTH\WindowsFormsAppJTTH\Program.cs:line 19

@EtienneCmb
Copy link
Owner

Hi @STREETKILLER007 , this don't seems to be related to visbrain and I don't see the point of this issue.

@STREETKILLER007
Copy link
Author

@EtienneCmb I think it is just the problem on set up pythonnet, so i think it can be useful in the future for reference purpose.

@EtienneCmb
Copy link
Owner

I've no doubt that it could be interesting for other people but this is not related to visbrain and this is not a forum.

@STREETKILLER007
Copy link
Author

ok, noted.
Will just put issue of Visbrain here.

Repository owner locked as spam and limited conversation to collaborators Aug 16, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants