Skip to content

Error building in Linux #571

Closed
Closed

Description

@Cronan

Environment

  • Pythonnet version: 2.4.0
  • Python version: 2.7.5
  • Operating System: Red Hat Enterprise Linux Server release 7.3 (Maipo)
  • DotNet version: 2.0.0

Details

  • Error restoring packages while trying to build from the command line in Linux

  • I used the following commands to create the issue:

    pip install wheel
    pip install pytest
    git clone https://github.com/pythonnet/pythonnet.git
    cd pythonnet
    python setup.py bdist_wheel --xplat
  • Details of the error below:
running bdist_wheel
running build
running build_ext
Microsoft (R) Build Engine version 15.3.409.57025 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  Restore completed in 24.15 ms for /users/isys/icronyn/git/pythonnet/src/testing/Python.Test.15.csproj.
  Restore completed in 24.16 ms for /users/isys/icronyn/git/pythonnet/src/console/Console.15.csproj.
  Restore completed in 26.29 ms for /users/isys/icronyn/git/pythonnet/src/runtime/Python.Runtime.15.csproj.
  Restore completed in 86.12 ms for /users/isys/icronyn/git/pythonnet/src/embed_tests/Python.EmbeddingTest.15.csproj.
Microsoft (R) Build Engine version 15.3.409.57025 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

Microsoft (R) Build Engine version 15.3.409.57025 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

pyobject.cs(50,13): warning CS0162: Unreachable code detected [/users/isys/icronyn/git/pythonnet/src/runtime/Python.Runtime.15.csproj]
pythonexception.cs(64,13): warning CS0162: Unreachable code detected [/users/isys/icronyn/git/pythonnet/src/runtime/Python.Runtime.15.csproj]
delegatemanager.cs(204,13): warning CS0162: Unreachable code detected [/users/isys/icronyn/git/pythonnet/src/runtime/Python.Runtime.15.csproj]
pyscope.cs(534,13): warning CS0162: Unreachable code detected [/users/isys/icronyn/git/pythonnet/src/runtime/Python.Runtime.15.csproj]
  Python.Runtime.15 -> /users/isys/icronyn/git/pythonnet/src/runtime/bin/Python.Runtime.dll
pyobject.cs(50,13): warning CS0162: Unreachable code detected [/users/isys/icronyn/git/pythonnet/src/runtime/Python.Runtime.15.csproj]
delegatemanager.cs(204,13): warning CS0162: Unreachable code detected [/users/isys/icronyn/git/pythonnet/src/runtime/Python.Runtime.15.csproj]
pythonexception.cs(64,13): warning CS0162: Unreachable code detected [/users/isys/icronyn/git/pythonnet/src/runtime/Python.Runtime.15.csproj]
pyscope.cs(534,13): warning CS0162: Unreachable code detected [/users/isys/icronyn/git/pythonnet/src/runtime/Python.Runtime.15.csproj]
  Python.Runtime.15 -> /users/isys/icronyn/git/pythonnet/src/runtime/bin/netstandard2.0/Python.Runtime.dll
  Console.15 -> /users/isys/icronyn/git/pythonnet/src/console/bin/nPython.exe
  Python.Test.15 -> /users/isys/icronyn/git/pythonnet/src/testing/bin/Python.Test.dll
dynamic.cs(121,28): warning CS0618: 'PythonEngine.RunString(string, IntPtr?, IntPtr?)' is obsolete: 'RunString is deprecated and will be removed. Use Exec/Eval/RunSimpleString instead.' [/users/isys/icronyn/git/pythonnet/src/embed_tests/Python.EmbeddingTest.15.csproj]
  Python.EmbeddingTest.15 -> /users/isys/icronyn/git/pythonnet/src/embed_tests/bin/Python.EmbeddingTest.dll
  Python.Test.15 -> /users/isys/icronyn/git/pythonnet/src/testing/bin/netstandard2.0/Python.Test.dll
  Console.15 -> /users/isys/icronyn/git/pythonnet/src/console/bin/netcoreapp2.0/nPython.dll
dynamic.cs(121,28): warning CS0618: 'PythonEngine.RunString(string, IntPtr?, IntPtr?)' is obsolete: 'RunString is deprecated and will be removed. Use Exec/Eval/RunSimpleString instead.' [/users/isys/icronyn/git/pythonnet/src/embed_tests/Python.EmbeddingTest.15.csproj]
  Python.EmbeddingTest.15 -> /users/isys/icronyn/git/pythonnet/src/embed_tests/bin/netcoreapp2.0/Python.EmbeddingTest.dll
Microsoft (R) Build Engine version 15.3.409.57025 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  Python.Runtime.15 -> /users/isys/icronyn/git/pythonnet/src/runtime/bin/netstandard2.0/Python.Runtime.dll
  Console.15 -> /users/isys/icronyn/git/pythonnet/src/console/bin/netcoreapp2.0/nPython.dll
  Console.15 -> /users/isys/icronyn/git/pythonnet/build/lib.linux-x86_64-2.7/netcoreapp2.0/
  Python.EmbeddingTest.15 -> /users/isys/icronyn/git/pythonnet/src/embed_tests/bin/netcoreapp2.0/Python.EmbeddingTest.dll
  Python.EmbeddingTest.15 -> /users/isys/icronyn/git/pythonnet/src/embed_tests/bin/netcoreapp2.0_publish/
Package mono-2 was not found in the pkg-config search path.
Perhaps you should add the directory containing `mono-2.pc'
to the PKG_CONFIG_PATH environment variable
No package 'mono-2' found
Traceback (most recent call last):
  File "setup.py", line 522, in <module>
    zip_safe=False,
  File "/opt/man/releases/python-medusa/27-1/lib/python2.7/distutils/core.py", line 151, in setup
    dist.run_commands()
  File "/opt/man/releases/python-medusa/27-1/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/opt/man/releases/python-medusa/27-1/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "setup.py", line 470, in run
    return bdist_wheel.bdist_wheel.run(self)
  File "/users/isys/icronyn/pyenvs/pythonnet/lib/python2.7/site-packages/wheel-0.30.0-py2.7.egg/wheel/bdist_wheel.py", line 204, in run
    self.run_command('build')
  File "/opt/man/releases/python-medusa/27-1/lib/python2.7/distutils/cmd.py", line 326, in run_command
    self.distribution.run_command(command)
  File "/opt/man/releases/python-medusa/27-1/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/opt/man/releases/python-medusa/27-1/lib/python2.7/distutils/command/build.py", line 127, in run
    self.run_command(cmd_name)
  File "/opt/man/releases/python-medusa/27-1/lib/python2.7/distutils/cmd.py", line 326, in run_command
    self.distribution.run_command(command)
  File "/opt/man/releases/python-medusa/27-1/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/opt/man/releases/python-medusa/27-1/lib/python2.7/distutils/command/build_ext.py", line 339, in run
    self.build_extensions()
  File "/opt/man/releases/python-medusa/27-1/lib/python2.7/distutils/command/build_ext.py", line 448, in build_extensions
    self.build_extension(ext)
  File "setup.py", line 270, in build_extension
    self._build_monoclr()
  File "setup.py", line 284, in _build_monoclr
    mono_libs = _check_output("pkg-config --libs mono-2", shell=True)
  File "setup.py", line 98, in _check_output
    output = subprocess.check_output(*args, **kwargs)
  File "/opt/man/releases/python-medusa/27-1/lib/python2.7/subprocess.py", line 573, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command 'pkg-config --libs mono-2' returned non-zero exit status 1

Activity

  1. Cronan commented on Nov 14, 2017

    @Cronan
    ContributorAuthor

    Is this the same as #555 ?

  2. Cronan commented on Nov 14, 2017

    @Cronan
    ContributorAuthor

    Also tried the following as referred to by @dmitriyse in #531 :

    python setup.py build_ext --xplat --inplace

    Same error.

  3. dmitriyse commented on Nov 14, 2017

    @dmitriyse
    Contributor

    I need to research what the reason of mono-2 related problems. This error occurs not only in your environment.

  4. Cronan commented on Nov 14, 2017

    @Cronan
    ContributorAuthor

    Let me know if you need me to try help with debugging, provide extra log, etc

  5. den-run-ai commented on Nov 14, 2017

    @den-run-ai
    Contributor

    @Cronan what mono version do you have installed? and how did you install it? did you try without --xplat?

  6. Cronan commented on Nov 14, 2017

    @Cronan
    ContributorAuthor

    I don't have mono installed - is it still a requirement even with --xplat?

  7. dmitriyse commented on Nov 14, 2017

    @dmitriyse
    Contributor

    No, it's should not be required with --xplat option. Probably we have bug.

  8. Cronan commented on Nov 14, 2017

    @Cronan
    ContributorAuthor

    Setup.py contains:

    def _build_monoclr(self):
            mono_libs = _check_output("pkg-config --libs mono-2", shell=True)
            mono_cflags = _check_output("pkg-config --cflags mono-2", shell=True)
            glib_libs = _check_output("pkg-config --libs glib-2.0", shell=True)
            glib_cflags = _check_output("pkg-config --cflags glib-2.0", shell=True)
            cflags = mono_cflags.strip() + " " + glib_cflags.strip()
            libs = mono_libs.strip() + " " + glib_libs.strip()

    This is called here:

    if DEVTOOLS == "Mono" or DEVTOOLS == "dotnet":
                self._build_monoclr()

    It's basically a call to subprocess.check_output("pkg-config --libs mono-2", shell=True) that returning 1, which I'd expect, because I don't have mono installed.

    Unless I'm oversimplifying ...

  9. dmitriyse commented on Nov 14, 2017

    @dmitriyse
    Contributor

    Yes, some problem exists. I need to re-inspect all setup.py to fix this problem. Stay tuned, I think I will fix it until tomorrow.

  10. Cronan commented on Nov 14, 2017

    @Cronan
    ContributorAuthor

    Works:

    >>> subprocess.check_output("pkg-config --libs glib-2.0", shell=True)
    '-lglib-2.0  \n'

    Fails:

    >>> subprocess.check_output("pkg-config --libs mono-2", shell=True)
    Package mono-2 was not found in the pkg-config search path.
    Perhaps you should add the directory containing `mono-2.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'mono-2' found
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/opt/man/releases/python-medusa/27-1/lib/python2.7/subprocess.py", line 573, in check_output
        raise CalledProcessError(retcode, cmd, output=output)
    subprocess.CalledProcessError: Command 'pkg-config --libs mono-2' returned non-zero exit status 1

    Both run inside my python interpreter.

  11. dmitriyse commented on Nov 15, 2017

    @dmitriyse
    Contributor

    monoclr module can be build only when mono is installed.
    When you have only dotnet core, it's should be allowed to work without monoclr module.
    Currently the only way to work with pythonnet vs dotnet core is to run:

    dotnet netcoreapp2.0/nPython.dll
  12. self-assigned this
    on Nov 15, 2017
  13. Cronan commented on Dec 7, 2017

    @Cronan
    ContributorAuthor

    I finally managed to build by editing setup.py, modifying the following line in BuildExtPythonnet.build_extension:

    if DEVTOOLS == "Mono": #or DEVTOOLS == "dotnet":
    self._build_monoclr()

    This seems to complete the build, and I can then run using nPython:
    dotnet ./build/lib.linux-x86_64-2.7/netcoreapp2.0/nPython.dll
    >>>import clr
    >>>from System import String, Char, Int32
    >>>s = String.Overloads[Char, Int32]('A', 10)
    >>> s.get_Length()
    10

    But as soon as I try other things, it crashes hard:
    >>> from System.Collections.Generic import Dictionary

    Expression: [Recursive resource lookup bug]
    Description: Infinite recursion during resource lookup within System.Private.CoreLib.  This may be a bug in System.Private.CoreLib, or potentially in certain extensibility points such as assembly resolve events or CultureInfo names.  Resource name: ArgumentNull_Generic
    Stack Trace:
       at System.SR.InternalGetResourceString(String key)
       at System.SR.GetResourceString(String resourceKey, String defaultString)
       at System.ArgumentNullException..ctor(String paramName)
       at System.Runtime.Loader.AssemblyLoadContext.GetLoadContext(Assembly assembly)
       at System.Reflection.Assembly.LoadFromResolveHandler(Object sender, ResolveEventArgs args)
       at System.AppDomain.OnAssemblyResolveEvent(RuntimeAssembly assembly, String assemblyFullName)
       at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks, IntPtr ptrLoadContextBinder)
       at System.Reflection.RuntimeAssembly.InternalGetSatelliteAssembly(String name, CultureInfo culture, Version version, Boolean throwOnFileNotFound, StackCrawlMark& stackMark)
       at System.Resources.ManifestBasedResourceGroveler.GetSatelliteAssembly(CultureInfo lookForCulture, StackCrawlMark& stackMark)
       at System.Resources.ManifestBasedResourceGroveler.GrovelForResourceSet(CultureInfo culture, Dictionary`2 localResourceSets, Boolean tryParents, Boolean createIfNotExists, StackCrawlMark& stackMark)
       at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo requestedCulture, Boolean createIfNotExists, Boolean tryParents, StackCrawlMark& stackMark)
       at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents)
       at System.Resources.ResourceManager.GetString(String name, CultureInfo culture)
       at System.SR.InternalGetResourceString(String key)
       at System.SR.GetResourceString(String resourceKey, String defaultString)
       at System.ArgumentNullException..ctor(String paramName)
       at System.Runtime.Loader.AssemblyLoadContext.GetLoadContext(Assembly assembly)
       at System.Reflection.Assembly.LoadFromResolveHandler(Object sender, ResolveEventArgs args)
       at System.AppDomain.OnAssemblyResolveEvent(RuntimeAssembly assembly, String assemblyFullName)
       at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks, IntPtr ptrLoadContextBinder)
       at System.Reflection.RuntimeAssembly.InternalGetSatelliteAssembly(String name, CultureInfo culture, Version version, Boolean throwOnFileNotFound, StackCrawlMark& stackMark)
       at System.Resources.ManifestBasedResourceGroveler.GetSatelliteAssembly(CultureInfo lookForCulture, StackCrawlMark& stackMark)
       at System.Resources.ManifestBasedResourceGroveler.GrovelForResourceSet(CultureInfo culture, Dictionary`2 localResourceSets, Boolean tryParents, Boolean createIfNotExists, StackCrawlMark& stackMark)
       at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo requestedCulture, Boolean createIfNotExists, Boolean tryParents, StackCrawlMark& stackMark)
       at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents)
       at System.Resources.ResourceManager.GetString(String name, CultureInfo culture)
       at System.SR.InternalGetResourceString(String key)
       at System.SR.GetResourceString(String resourceKey, String defaultString)
       at System.Runtime.Loader.AssemblyLoadContext.ResolveUsingEvent(AssemblyName assemblyName)
       at System.Runtime.Loader.AssemblyLoadContext.ResolveUsingResolvingEvent(IntPtr gchManagedAssemblyLoadContext, AssemblyName assemblyName)
       at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks, IntPtr ptrLoadContextBinder)
       at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, IntPtr ptrLoadContextBinder)
       at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection)
       at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
       at System.Reflection.Assembly.Load(String assemblyString)
       at Python.Runtime.AssemblyManager.LoadAssembly(String name) in /users/isys/icronyn/git/pythonnet/src/runtime/assemblymanager.cs:line 199
       at Python.Runtime.AssemblyManager.LoadImplicit(String name, Boolean warn) in /users/isys/icronyn/git/pythonnet/src/runtime/assemblymanager.cs:line 311
       at Python.Runtime.ModuleObject.GetAttribute(String name, Boolean guess) in /users/isys/icronyn/git/pythonnet/src/runtime/moduleobject.cs:line 125
       at Python.Runtime.ModuleObject.tp_getattro(IntPtr ob, IntPtr key) in /users/isys/icronyn/git/pythonnet/src/runtime/moduleobject.cs:line 276
       at Python.Runtime.Runtime.PyObject_Call(IntPtr pointer, IntPtr args, IntPtr kw)
       at Python.Runtime.Runtime.PyObject_Call(IntPtr pointer, IntPtr args, IntPtr kw)
       at Python.Runtime.ImportHook.__import__(IntPtr self, IntPtr args, IntPtr kw) in /users/isys/icronyn/git/pythonnet/src/runtime/importhook.cs:line 236
       at Python.Runtime.Runtime.Py_Main(Int32 argc, String[] argv)
       at Python.Runtime.Runtime.Py_Main(Int32 argc, String[] argv)
       at Python.Runtime.PythonConsole.Main(String[] args) in /users/isys/icronyn/git/pythonnet/src/console/pythonconsole.cs:line 37```
    
  14. Cronan commented on Dec 7, 2017

    @Cronan
    ContributorAuthor

    I'm also unable to run the tests:

    >>> pythonnet$ python -m pytest
    from pkg_resources import iter_entry_points, DistributionNotFound
    ============================= test session starts ==============================
    platform linux2 -- Python 2.7.11, pytest-2.9.1, py-1.4.31, pluggy-0.3.1
    rootdir: /users/isys/xxxx/git/pythonnet, inifile: 
    plugins: cov-2.2.1, shutil-1.2.8, virtualenv-1.2.7
    collected 0 items / 1 errors 
    
    ==================================== ERRORS ====================================
    ______________________________ ERROR collecting  _______________________________
    ../../pyenvs/pythonnet/lib/python2.7/site-packages/py-1.4.31-py2.7.egg/py/_path/common.py:332: in visit
        for x in Visitor(fil, rec, ignore, bf, sort).gen(self):
    ../../pyenvs/pythonnet/lib/python2.7/site-packages/py-1.4.31-py2.7.egg/py/_path/common.py:378: in gen
        for p in self.gen(subdir):
    ../../pyenvs/pythonnet/lib/python2.7/site-packages/py-1.4.31-py2.7.egg/py/_path/common.py:368: in gen
        if p.check(dir=1) and (rec is None or rec(p))])
    ../../pyenvs/pythonnet/lib/python2.7/site-packages/pytest-2.9.1-py2.7.egg/_pytest/main.py:647: in _recurse
        ihook = self.gethookproxy(path)
    ../../pyenvs/pythonnet/lib/python2.7/site-packages/pytest-2.9.1-py2.7.egg/_pytest/main.py:550: in gethookproxy
        my_conftestmodules = pm._getconftestmodules(fspath)
    ../../pyenvs/pythonnet/lib/python2.7/site-packages/pytest-2.9.1-py2.7.egg/_pytest/config.py:297: in _getconftestmodules
        mod = self._importconftest(conftestpath)
    ../../pyenvs/pythonnet/lib/python2.7/site-packages/pytest-2.9.1-py2.7.egg/_pytest/config.py:322: in _importconftest
        raise ConftestImportFailure(conftestpath, sys.exc_info())
    E   ConftestImportFailure: (local('/users/isys/xxxx/git/pythonnet/src/tests/conftest.py'), (<type 'exceptions.ImportError'>, ImportError('No module named clr',), <traceback object at 0x7f58fdf12cf8>))
    =========================== 1 error in 0.15 seconds ============================
    
  15. Cronan commented on Dec 8, 2017

    @Cronan
    ContributorAuthor

    I managed to get the tests working in nPython by appending pytest and py to the sys.path.
    However, the stack trace obtained looks very similar to the recursion issue I see above:

    >>> import pytest
    >>> pytest.main()
    ==================================== test session starts ====================================
    platform linux2 -- Python 2.7.5, pytest-2.9.1, py-1.4.31, pluggy-0.3.1
    rootdir: /users/isys/icronyn/git/pythonnet, inifile: 
    Assert Failure
    Expression: [Recursive resource lookup bug]
    Description: Infinite recursion during resource lookup within System.Private.CoreLib.  This may be a bug in System.Private.CoreLib, or potentially in certain extensibility points such as assembly resolve events or CultureInfo names.  Resource name: ArgumentNull_Generic
    Stack Trace:
       at System.SR.InternalGetResourceString(String key)
       at System.SR.GetResourceString(String resourceKey, String defaultString)
       at System.ArgumentNullException..ctor(String paramName)
       at System.Runtime.Loader.AssemblyLoadContext.GetLoadContext(Assembly assembly)
       at System.Reflection.Assembly.LoadFromResolveHandler(Object sender, ResolveEventArgs args)
       at System.AppDomain.OnAssemblyResolveEvent(RuntimeAssembly assembly, String assemblyFullName)
       at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks, IntPtr ptrLoadContextBinder)
       at System.Reflection.RuntimeAssembly.InternalGetSatelliteAssembly(String name, CultureInfo culture, Version version, Boolean throwOnFileNotFound, StackCrawlMark& stackMark)
       at System.Resources.ManifestBasedResourceGroveler.GetSatelliteAssembly(CultureInfo lookForCulture, StackCrawlMark& stackMark)
       at System.Resources.ManifestBasedResourceGroveler.GrovelForResourceSet(CultureInfo culture, Dictionary`2 localResourceSets, Boolean tryParents, Boolean createIfNotExists, StackCrawlMark& stackMark)
       at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo requestedCulture, Boolean createIfNotExists, Boolean tryParents, StackCrawlMark& stackMark)
       at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents)
       at System.Resources.ResourceManager.GetString(String name, CultureInfo culture)
       at System.SR.InternalGetResourceString(String key)
       at System.SR.GetResourceString(String resourceKey, String defaultString)
       at System.ArgumentNullException..ctor(String paramName)
       at System.Runtime.Loader.AssemblyLoadContext.GetLoadContext(Assembly assembly)
       at System.Reflection.Assembly.LoadFromResolveHandler(Object sender, ResolveEventArgs args)
       at System.AppDomain.OnAssemblyResolveEvent(RuntimeAssembly assembly, String assemblyFullName)
       at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks, IntPtr ptrLoadContextBinder)
       at System.Reflection.RuntimeAssembly.InternalGetSatelliteAssembly(String name, CultureInfo culture, Version version, Boolean throwOnFileNotFound, StackCrawlMark& stackMark)
       at System.Resources.ManifestBasedResourceGroveler.GetSatelliteAssembly(CultureInfo lookForCulture, StackCrawlMark& stackMark)
       at System.Resources.ManifestBasedResourceGroveler.GrovelForResourceSet(CultureInfo culture, Dictionary`2 localResourceSets, Boolean tryParents, Boolean createIfNotExists, StackCrawlMark& stackMark)
       at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo requestedCulture, Boolean createIfNotExists, Boolean tryParents, StackCrawlMark& stackMark)
       at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents)
       at System.Resources.ResourceManager.GetString(String name, CultureInfo culture)
       at System.SR.InternalGetResourceString(String key)
       at System.SR.GetResourceString(String resourceKey, String defaultString)
       at System.Runtime.Loader.AssemblyLoadContext.ResolveUsingEvent(AssemblyName assemblyName)
       at System.Runtime.Loader.AssemblyLoadContext.ResolveUsingResolvingEvent(IntPtr gchManagedAssemblyLoadContext, AssemblyName assemblyName)
       at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks, IntPtr ptrLoadContextBinder)
       at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, IntPtr ptrLoadContextBinder)
       at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection)
       at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
       at System.Reflection.Assembly.Load(String assemblyString)
       at Python.Runtime.AssemblyManager.LoadAssembly(String name) in /users/isys/icronyn/git/pythonnet/src/runtime/assemblymanager.cs:line 199
       at Python.Runtime.AssemblyManager.LoadImplicit(String name, Boolean warn) in /users/isys/icronyn/git/pythonnet/src/runtime/assemblymanager.cs:line 311
       at Python.Runtime.ModuleObject.GetAttribute(String name, Boolean guess) in /users/isys/icronyn/git/pythonnet/src/runtime/moduleobject.cs:line 125
       at Python.Runtime.ModuleObject.tp_getattro(IntPtr ob, IntPtr key) in /users/isys/icronyn/git/pythonnet/src/runtime/moduleobject.cs:line 276
       at Python.Runtime.Runtime.Py_Main(Int32 argc, String[] argv)
       at Python.Runtime.Runtime.Py_Main(Int32 argc, String[] argv)
       at Python.Runtime.PythonConsole.Main(String[] args) in /users/isys/icronyn/git/pythonnet/src/console/pythonconsole.cs:line 37
    
  16. Cronan commented on Dec 8, 2017

    @Cronan
    ContributorAuthor

    Oh dear
    https://github.com/dotnet/coreclr/issues/12668

    Looks like it was fixed but missed the cutoff for the 2.0.0 release
    Now if I could only work out how to change the thread culture from inside pythonengine.cs ...

    Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US");
    Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
    

    Any hints where I could do this as a workaround?
    I tried doing it after PythonEngine.Initialize();, but it doesn't seem to make a difference ...

  17. den-run-ai commented on Dec 8, 2017

    @den-run-ai
    Contributor

    @Cronan can't you just switch your local CultureInfo settings on this machine as a temporary workaround?

  18. den-run-ai commented on Dec 8, 2017

    @den-run-ai
    Contributor

    @Cronan alternatively just install .NET Core 2.0.3 released few weeks ago: https://github.com/dotnet/core/blob/master/release-notes/download-archives/2.0.3.md

  19. Cronan commented on Dec 8, 2017

    @Cronan
    ContributorAuthor

    @denfromufa I don't have a dedicated headnode, and 2.0.3 won't be available via the standard Enterprise upgrade cycle for a few weeks, but I've got a plan to test this on Monday.

  20. Cronan commented on Dec 8, 2017

    @Cronan
    ContributorAuthor

    @denfromufa OK, figured out how to change my locale, and the tests are now running.
    Any ideas what this could be? Is it fixed by something in another branch?

    ============================================================================== test session starts ==============================================================================
    platform linux2 -- Python 2.7.5, pytest-2.9.1, py-1.4.31, pluggy-0.3.1
    rootdir: /users/isys/icronyn/git/pythonnet, inifile: 
    collected 376 items 
    
    src/tests/test_array.py .....................................F..
    src/tests/test_callback.py ..
    src/tests/test_class.py .......F..F..FF...
    src/tests/test_clrmethod.py FFFFF
    src/tests/test_compat.py ......FFFF....F.
    src/tests/test_constructors.py ....
    src/tests/test_conversion.py ....................
    src/tests/test_delegate.py ...
    Unhandled Exception: System.MissingMethodException: Constructor on type 'System.Reflection.Emit.TypeBuilder' not found.
       at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
       at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
       at System.Activator.CreateInstance(Type type, Object[] args)
       at Python.Runtime.DelegateManager.GetDelegate(Type dtype, IntPtr callable) in /users/isys/icronyn/git/pythonnet/src/runtime/delegatemanager.cs:line 159
       at Python.Runtime.DelegateObject.tp_new(IntPtr tp, IntPtr args, IntPtr kw) in /users/isys/icronyn/git/pythonnet/src/runtime/delegateobject.cs:line 61
       at Python.Runtime.MetaType.tp_call(IntPtr tp, IntPtr args, IntPtr kw) in /users/isys/icronyn/git/pythonnet/src/runtime/metatype.cs:line 148
       at Python.Runtime.Runtime.Py_Main(Int32 argc, String[] argv)
       at Python.Runtime.PythonConsole.Main(String[] args) in /users/isys/icronyn/git/pythonnet/src/console/pythonconsole.cs:line 37
    Aborted
    
  21. Cronan commented on Dec 12, 2017

    @Cronan
    ContributorAuthor

    Fixed with #572

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions