Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Unable to find an entry point named 'PyNumber_Divide' when trying to call an overridden division operator #802

Closed
Assignees
filmor
Labels
Milestone
@lostmsu

Description

@lostmsu

Environment

  • Pythonnet version: 2.3
  • Python version: 3.6.6
  • Operating System: Windows 10 x64

Details

I was trying to dynamically call overridden division operator:

dynamictf=Py.Import("tensorflow");varc=tf.constant(42,tf.float32)/2;

Traceback:

    System.EntryPointNotFoundException: 'Unable to find an entry point named 'PyNumber_Divide' in DLL 'python36'.'at Python.Runtime.Runtime.PyNumber_Divide(IntPtr o1, IntPtr o2)at Python.Runtime.PyObject.TryBinaryOperation(BinaryOperationBinder binder, Object arg, Object& result)at CallSite.Target(Closure , CallSite , Object , Int32 )at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)

It works for+ 2 in place of/ 2, but might affect other operators too.

Workaround

The workaround is to do.__div__(2) instead of/ 2

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp