Skip to content

Pythonnet version: 2.4.0.dev0 running: import clr, throws exception System.NotImplementedException: No support for x86 #772

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

Closed
vanillycpp opened this issue Nov 10, 2018 · 11 comments

Comments

@vanillycpp
Copy link

Environment

  • Pythonnet version: 2.4.0.dev0
  • Python version: 2.7.1
  • Operating System: Win7 x86
  • .NET version 4.6.01055

Details

on installation of 2.3.0 vrsion have this error
#609

I installed pythonnet 2.4.0.dev0 from current master
and try to run

import clr

and got this error

Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NotImplementedException: No support for x86
   at Python.Runtime.TypeManager.NativeCode.get_Active()
   at Python.Runtime.TypeManager.InitializeNativeCodePage()
   at Python.Runtime.TypeManager.InitializeSlots(IntPtr type, Type impl)
   at Python.Runtime.TypeManager.CreateMetaType(Type impl)
   at Python.Runtime.MetaType.Initialize()
   at Python.Runtime.Runtime.Initialize()
   at Python.Runtime.PythonEngine.Initialize(IEnumerable`1 args, Boolean setSysArgv)
   at Python.Runtime.PythonEngine.InitExt()
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
   at clrModule.PyInit_clr()
@vanillycpp vanillycpp changed the title Pythonnet version: 2.4.0.dev0 run. import clr, throws exception Pythonnet version: 2.4.0.dev0 running: import clr, throws exception Nov 10, 2018
@vanillycpp vanillycpp changed the title Pythonnet version: 2.4.0.dev0 running: import clr, throws exception Pythonnet version: 2.4.0.dev0 running: import clr, throws exception System.NotImplementedException: No support for x86 Nov 10, 2018
@den-run-ai
Copy link
Contributor

How did you install or build pythonnet?

@vanillycpp
Copy link
Author

I run commands from "GitHub installation from master branch"
https://github.com/pythonnet/pythonnet/wiki/Installation
but I had troubles with this command

setup.py bdist_wheel --xplat

I output with error

running bdist_wheel
running build
running build_ext
error: [WinError 2] The system cannot find the file specified

then I try to look at setyp.py and found that in this part

pythonnet/setup.py

Lines 311 to 321 in f8e147b

use_shell = DEVTOOLS == "Mono" or DEVTOOLS == "dotnet"
if DEVTOOLS == "MsDev15" or DEVTOOLS == "dotnet":
if DEVTOOLS == "MsDev15":
_config = "{0}Win".format(CONFIG)
elif DEVTOOLS == "dotnet":
_config = "{0}Mono".format(CONFIG)
cmd = "dotnet msbuild /t:Restore pythonnet.15.sln /p:Configuration={0} /p:Platform={1}".format(_config, ARCH)
self.debug_print("Updating packages with xplat: {0}".format(cmd))
subprocess.check_call(cmd, shell=use_shell)

here use_shell = DEVTOOLS == "Mono" or DEVTOOLS == "dotnet"
i had no .net sdk installed and no Mono, just Visual Studio
and my DEVTOOLS had value MsDev15

and wthout shell (shell=false) this command
subprocess.check_call(cmd, shell=use_shell)
got error error: [WinError 2] The system cannot find the file specified

when I installed .net sdk
have no error more
I think it should be somewehre in requirenments, or I shoud see error to with problem definition

@den-run-ai
Copy link
Contributor

@vanillycpp the option --xplat is for .net core build. So try without this option, since you are using .NET Framework.

@vanillycpp
Copy link
Author

installing without --xplat has no errors during installation
but when I try to import clr I got error for witch I startetd this issue

@den-run-ai
Copy link
Contributor

@vanillycpp what do you get from import platform; platform.machine() ?

Currently the recognized machine mappings are:

static readonly Dictionary<string, MachineType> MachineTypeMapping = new Dictionary<string, MachineType>()
        {
            { "i386", MachineType.i386 },
            { "x86_64", MachineType.x86_64 },
            { "amd64", MachineType.x86_64 },
        };

@vanillycpp
Copy link
Author

vanillycpp commented Nov 12, 2018

this code import platform; platform.machine()
gives me x86

from cmd systeminfo

OS:                              Microsoft Windows 7 Ultimate
OS Version:                      6.1.7601 Service Pack 1 build 7601
System type:                     X86-based PC

@den-run-ai
Copy link
Contributor

den-run-ai commented Nov 12, 2018

@vanillycpp ok, we need to add x86 to the Dictionary above, thanks for reporting this! Let me know if you would like to make this PR. Here are all the possible values for platform.machine():

https://stackoverflow.com/questions/45125516/possible-values-for-uname-m

@filmor
Copy link
Member

filmor commented Nov 13, 2018

From this overview alone, we need to add x86, i686, and x64.

@filmor
Copy link
Member

filmor commented Nov 14, 2018

I've added the names, after the PR is merged this should work fine. Odd that this didn't show up in AppVeyor...

@filmor
Copy link
Member

filmor commented Nov 14, 2018

Fixed by #775.

@filmor filmor closed this as completed Nov 14, 2018
@asferatum
Copy link

Hellow!
I installed pythonnet from pythonnet‑2.5.2‑cp39‑cp39‑win_amd64.whl from here and so I have the same error as in head of topic.

Next code
import platform; platform.machine()
returns 'AMD64' in upper case, so I think this is same problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants