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

Could not load file or assembly 'Python.Runtime, Version=2.4.0.0... #665

Closed
@tomunger

Description

@tomunger

Environment

  • Pythonnet version: 2.4.00
  • Python version: 2.7.13
  • Operating System: Windows 7

Details

  • Describe what you were trying to get done.

I have usedpip install git+https://github.com/pythonnet/pythonnet
to install latest python net.

I've created a .NET visual studio 2015 project to make calls to Python. I reference the Python.Runtime.dll file in the project. When I let it get copied to the binary directory of my project calls to CPython work fine.

Now, I don't want to bundle the DLL with my application. As I understand, different versions work with different versions of CPython. I would like to load Python.Runtime.dll from Lib\site-packages so I get version appropriate for version of Python installed on the system. I change properties of the PythonRuntime.dll reference to NOT copy the DLL to bin directory. Now I get the error:

An unhandled exception of type 'System.IO.FileNotFoundException' occurred in PyRunner.exeAdditional information: Could not load file or assembly 'Python.Runtime, Version=2.4.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

This minimal program causes the error.

using Python.Runtime;namespace PyRunner{class ErrorExample{static void Main(string[] args){PythonEngine.Initialize();}}}

I've tracked down other issues related to this but none seem to simply be that the DLL is not found.

When I try to install the assembly in the GAC I get

>gacutil /i Lib\site-packages\Python.Runtime.dllMicrosoft (R) .NET Global Assembly Cache Utility.  Version 4.0.30319.0Copyright (c) Microsoft Corporation.  All rights reserved.Failure adding assembly to the cache: Attempt to install an assembly without a strong name

Thanks

Metadata

Metadata

Assignees

No one assigned

    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


      [8]ページ先頭

      ©2009-2025 Movatter.jp