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

macOS: AddReference find the reference, but the module is not found #643

Closed
@AlexCatarino

Description

@AlexCatarino

Environment

  • Pythonnet version: Latest
  • Python version: 3.6
  • Operating System: macOS

Details

We have compiledPython.Runtime.dll for python 3.6 in Windows for each OS: Windows, macOS and Linux. Then we create a nuget package to distribute the library (along withnPython.exe) to be used withLean. The following commands were used:

msbuild pythonnet.sln /nologo /v:quiet /t:Clean;Rebuild /p:Platform=x64 /p:PythonInteropFile="interop36.cs" /p:Configuration=ReleaseWin /p:DefineConstants="PYTHON36,PYTHON3,UCS2"msbuild pythonnet.sln /nologo /v:quiet /t:Clean;Rebuild /p:Platform=x64 /p:PythonInteropFile="interop36.cs" /p:Configuration=ReleaseMono /p:DefineConstants="PYTHON36,PYTHON3,UCS2,MONO_OSX"msbuild pythonnet.sln /nologo /v:quiet /t:Clean;Rebuild /p:Platform=x64 /p:PythonInteropFile="interop36.cs" /p:Configuration=ReleaseMono /p:DefineConstants="PYTHON36,PYTHON3,UCS4,MONO_LINUX"

When execute nPython.exe in Windows and try to import System, I can do it successfully:

C:\Users\Alex\Lean\Launcher\bin\Debug>nPython.exePython 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:54:40) [MSC v.1900 64 bit (AMD64)] on win32Type "help", "copyright", "credits" or "license" for more information.>>> from clr import AddReference>>> ref = AddReference("System")>>> ref.FullName'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'>>> import System>>>

In Linux:

root@52578947ccd3:~/Lean/Launcher/bin/Debug# mono nPython.exePython 3.6.4 |Anaconda, Inc.| (default, Jan 16 2018, 18:12:19)[GCC 7.2.0] on linuxType "help", "copyright", "credits" or "license" for more information.>>> from clr import AddReference>>> ref = AddReference("System")>>> ref.FullName'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'>>> import System>>>

However, in macOS High Sierra:

Alexandres-Mac:Debug alex$ mono nPython.exe Python 3.6.4 |Anaconda, Inc.| (default, Jan 16 2018, 12:06:34) [GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwinType "help", "copyright", "credits" or "license" for more information.>>> from clr import AddReference>>> ref = AddReference("System")>>> ref.FullName'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'>>> import SystemTraceback (most recent call last):  File "<stdin>", line 1, in <module>ModuleNotFoundError: No module named 'System'

We added the symbolic link to the mono in python lib:

Alexandres-Mac:lib alex$ pwd/Users/alex/anaconda3/libAlexandres-Mac:lib alex$ ls -lrt mono*lrwxr-xr-x  1 alex  staff  60 Mar  9 04:07 mono -> /Library/Frameworks/Mono.framework/Versions/Current/lib/mono

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