8000 Libraries missing after setup.py install on OSX · Issue #392 · pythonnet/pythonnet · GitHub
[go: up one dir, main page]

Skip to content

Libraries missing after setup.py install on OSX #392

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
fractus opened this issue Feb 18, 2017 · 17 comments
Closed

Libraries missing after setup.py install on OSX #392

fractus opened this issue Feb 18, 2017 · 17 comments

Comments

@fractus
Copy link
Contributor
fractus commented Feb 18, 2017

Environment

  • Pythonnet version: v2.2.0-dev1-26-gb1cd3d1 (git describe --tags), branch mac-osx
  • Python version: Python 3.5.2 :: Anaconda 4.3.0 (x86_64)
  • Operating System: OSX El Capitan 10.11.6

Details

  1. Checked out the branch, and run python setup.py install. This worked, after setting
    'PKG_CONFIG_PATH=/Library/Frameworks/Mono.framework/Versions/4.6.2/lib/pkgconfig`
    (see dump below)

  2. Import fails

(py35) vasilios@exumas:~/Temp/pythonnet [mac-osx |12]
└─ $ python -c "import clr"
The assembly mscorlib.dll was not found or could not be loaded.
It should have been installed in the `/usr/local/anaconda/envs/py35/lib/mono/4.5/mscorlib.dll' directory.
  1. Manually added a symbolic link to the respective mono folder, and trying import again
vasilios@exumas: /usr/local/anaconda/envs/py35/lib
└─ $ ln -s /Library/Frameworks/Mono.framework/Versions/Current/lib/mono
(py35) vasilios@exumas:~/Temp/pythonnet [mac-osx |12]
└─ $ python -c "import clr"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: System.TypeInitializationException: The type initializer for 'Mono.Unix.Native.Stdlib' threw an exception. ---> System.DllNotFoundException: MonoPosixHelper
  at (wrapper managed-to-native) Mono.Unix.Native.Stdlib:GetDefaultSignal ()
  at Mono.Unix.Native.Stdlib..cctor () [0x00006] in <ebe430c916fe49219627b20fd4c89313>:0 
   --- End of inner exception stack trace ---
  at Mono.Unix.UnixMarshal.AllocHeap (System.Int64 size) [0x00018] in <ebe430c916fe49219627b20fd4c89313>:0 
  at Mono.Unix.UnixMarshal.StringToHeap (System.String s, System.Int32 index, System.Int32 count, System.Text.Encoding encoding) [0x00061] in <ebe430c916fe49219627b20fd4c89313>:0 
  at Mono.Unix.UnixMarshal.StringToHeap (System.String s, System.Text.Encoding encoding) [0x00008] in <ebe430c916fe49219627b20fd4c89313>:0 
  at Python.Runtime.Utf32Marshaler.MarshalManagedToNative (System.Object obj) [0x00019] in <e8f6e1fa95374383b3f862986f3e768c>:0 
  at (wrapper managed-to-native) Python.Runtime.Runtime:PyUnicode_FromKindAndString (int,string,int)
  at Python.Runtime.Runtime.PyUnicode_FromUnicode (System.String s, System.Int32 size) [0x00000] in <e8f6e1fa95374383b3f862986f3e768c>:0 
  at Python.Runtime.Runtime.PyUnicode_FromString (System.String s) [0x00007] in <e8f6e1fa95374383b3f862986f3e768c>:0 
  at Python.Runtime.Runtime.Initialize () [0x0010f] in <e8f6e1fa95374383b3f862986f3e768c>:0 
  at Python.Runtime.PythonEngine.Initialize () [0x00014] in <e8f6e1fa95374383b3f862986f3e768c>:0 
  at Python.Runtime.PythonEngine.InitExt () [0x00000] in <e8f6e1fa95374383b3f862986f3e768c>:0 

Still looking at this issue, just though this may take you a step further. Any help would appreciated.

Output of Step 1

(py35) vasilios@exumas:~/Temp/pythonnet [mac-osx | ✔]
└─ $ set | grep PKG
PKG_CONFIG_PATH=/Library/Frameworks/Mono.framework/Versions/4.6.2/lib/pkgconfig

(py35) vasilios@exumas:~/Temp/pythonnet [mac-osx | ✔]
└─ $ python setup.py install
/usr/local/anaconda/envs/py35/lib/python3.5/site-packages/setuptools-27.2.0-py3.5.egg/setuptools/dist.py:331: UserWarning: Normalizing '2.2.0-dev1' to '2.2.0.dev1'
running install
running bdist_egg
running egg_info
writing pythonnet.egg-info/PKG-INFO
writing top-level names to pythonnet.egg-info/top_level.txt
writing dependency_links to pythonnet.egg-info/dependency_links.txt
reading manifest file 'pythonnet.egg-info/SOURCES.txt'
writing manifest file 'pythonnet.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.6-x86_64/egg
running install_lib
running build_ext
Checking for updates from https://www.nuget.org/api/v2/.
Currently running NuGet.exe 3.5.0.
NuGet.exe is up to date.
MSBuild auto-detection: using msbuild version '14.1' from '/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/msbuild/14.1/bin/'.
All packages listed in packages.config are already installed.
XBuild Engine Version 14.0
Mono, Version 4.6.2.0
Copyright (C) 2005-2013 Various Mono authors
/Users/vasilios/Temp/pythonnet/pythonnet.sln:  warning : The project configuration for project 'clrmodule' corresponding to the solution configuration 'ReleaseMono|x64' was not found.
XBuild Engine Version 14.0
Mono, Version 4.6.2.0
Copyright (C) 2005-2013 Various Mono authors
		Configuration: ReleaseMono Platform: x64
assemblymanager.cs(206,37): warning CS0168: The variable `e' is declared but never used
classderived.cs(143,26): warning CS0219: The variable `fb' is assigned but its value is never used
classderived.cs(832,17): warning CS0219: The variable `t' is assigned but its value is never used
methodbinder.cs(145,36): warning CS0219: The variable `typeArgs' is assigned but its value is never used
methodbinding.cs(114,25): warning CS0219: The variable `len' is assigned but its value is never used
methodbinding.cs(153,24): warning CS0219: The variable `superType' is assigned but its value is never used
runtime.cs(2063,16): warning CS0472: The result of comparing value type `System.IntPtr' with null is always `true'
converter.cs(26,21): warning CS0414: The private field `Python.Runtime.Converter.decimalType' is assigned but its value is never used
/Users/vasilios/Temp/pythonnet/pythonnet.sln:  warning : The project configuration for project 'clrmodule' corresponding to the solution configuration 'ReleaseMono|x64' was not found.
Configuration: ReleaseMono Platform: x64
fieldtest.cs(21,17): warning CS0219: The variable `i' is assigned but its value is never used
fieldtest.cs(22,17): warning CS0219: The variable `j' is assigned but its value is never used
arraytest.cs(45,23): warning CS0414: The private field `Python.Test.PrivateArrayTest.items' is assigned but its value is never used
Configuration: ReleaseMono Platform: x64
pyimport.cs(47,17): warning CS0219: The variable `r' is assigned but its value is never used
Configuration: Release Platform: x64
assemblyinfo.cs(13,50): warning CS0618: `System.Security.Permissions.SecurityAction.RequestMinimum' is obsolete: `This requests should not be used'
pythonconsole.cs(18,28): warning CS0219: The variable `a' is assigned but its value is never used
creating build/bdist.macosx-10.6-x86_64
creating build/bdist.macosx-10.6-x86_64/egg
copying build/lib.macosx-10.6-x86_64-3.5/clr.cpython-35m-darwin.so -> build/bdist.macosx-10.6-x86_64/egg
creating stub loader for clr.cpython-35m-darwin.so
byte-compiling build/bdist.macosx-10.6-x86_64/egg/clr.py to clr.cpython-35.pyc
installing package data to build/bdist.macosx-10.6-x86_64/egg
running install_data
copying /Users/vasilios/Temp/pythonnet/build/lib.macosx-10.6-x86_64-3.5/Python.Runtime.dll -> build/bdist.macosx-10.6-x86_64/egg/../../../../../../../usr/local/anaconda/envs/py35/lib/python3.5/site-packages
creating build/bdist.macosx-10.6-x86_64/egg/EGG-INFO
copying pythonnet.egg-info/PKG-INFO -> build/bdist.macosx-10.6-x86_64/egg/EGG-INFO
copying pythonnet.egg-info/SOURCES.txt -> build/bdist.macosx-10.6-x86_64/egg/EGG-INFO
copying pythonnet.egg-info/dependency_links.txt -> build/bdist.macosx-10.6-x86_64/egg/EGG-INFO
copying pythonnet.egg-info/not-zip-safe -> build/bdist.macosx-10.6-x86_64/egg/EGG-INFO
copying pythonnet.egg-info/top_level.txt -> build/bdist.macosx-10.6-x86_64/egg/EGG-INFO
writing build/bdist.macosx-10.6-x86_64/egg/EGG-INFO/native_libs.txt
creating 'dist/pythonnet-2.2.0.dev1-py3.5-macosx-10.6-x86_64.egg' and adding 'build/bdist.macosx-10.6-x86_64/egg' to it
removing 'build/bdist.macosx-10.6-x86_64/egg' (and everything under it)
Processing pythonnet-2.2.0.dev1-py3.5-macosx-10.6-x86_64.egg
removing '/usr/local/anaconda/envs/py35/lib/python3.5/site-packages/pythonnet-2.2.0.dev1-py3.5-macosx-10.6-x86_64.egg' (and everything under it)
creating /usr/local/anaconda/envs/py35/lib/python3.5/site-packages/pythonnet-2.2.0.dev1-py3.5-macosx-10.6-x86_64.egg
Extracting pythonnet-2.2.0.dev1-py3.5-macosx-10.6-x86_64.egg to /usr/local/anaconda/envs/py35/lib/python3.5/site-packages
pythonnet 2.2.0.dev1 is already the active version in easy-install.pth

Installed /usr/local/anaconda/envs/py35/lib/python3.5/site-packages/pythonnet-2.2.0.dev1-py3.5-macosx-10.6-x86_64.egg
Processing dependencies for pythonnet==2.2.0.dev1
Finished processing dependencies for pythonnet==2.2.0.dev1
@den-run-ai
Copy link
Contributor

@fractus don't use mac osx branch, it is not finished. Also report your mono installation steps.

follow this issue on osx:

#120

@fractus
Copy link
Contributor Author
fractus commented Feb 18, 2017

Thanks -- I'll wait until it's merged.

  • My mono installation is from the package file from
    http://www.mono-project.com/download/.
  • I am not using any package managers.
  • Conda env is created by conda create -n py35 python=3.5 anaconda
  • pkg-config is build from sources.

@den-run-ai
Copy link
Contributor

@fractus the issue "System.DllNotFoundException: MonoPosixHelper" is quite known on Windows and OSX with Mono, just google it.

Also you may have more tested mono installation with brew install mono.

@vmuriart
Copy link
Contributor

@fractus have you tried building or using the current master branch? We removed references to mono libraries in b4710fc and 359e541.

@fractus
Copy link
Contributor Author
fractus commented Feb 24, 2017

@vmuriart

Thanks, it is working now, with a minor change in setup.py to use otool rather than ldd. You may want to incorporate this for OSX builds.

(py35) vasilios@exumas:~/Temp/pythonnet [master | ✚1 …1]
└─ $ git diff -- setup.py
diff --git a/setup.py b/setup.py
index 37a9365..b20775a 100644
--- a/setup.py
+++ b/setup.py
@@ -171,7 +171,7 @@ class BuildExtPythonnet(build_ext.build_ext):
             enable_shared = sysconfig.get_config_var("Py_ENABLE_SHARED")
             if enable_shared:
                 # Double-check if libpython is linked dynamically with python
-                lddout = _check_output(["ldd", sys.executable])
+                lddout = _check_output(["otool", "-L", sys.executable])
                 if 'libpython' not in lddout:
                     enable_shared = False

@vmuriart
Copy link
Contributor

The osx branch you originally used was mostly trying to setup Travis to test on OSX. @denfromufa we should probably delete the branch to avoid confusion in the future.

@fractus interested in submitting a PR for this? You can piggy-back on the platform check to determine which command should be called.

@vmuriart
Copy link
Contributor
vmuriart commented Mar 1, 2017

@fractus which part of the issue still remains unsolved? is it just PKG_CONFIG_PATH=/Library/Frameworks/Mono.framework/Versions/4.6.2/lib/pkgconfig now?

@fractus
Copy link
Contributor Author
fractus commented Mar 1, 2017

@vmuriart
Yes, for building and installing the package (for 2.7, 3.5 and 3.6).

In addition, though:

  • 3.5 and 3.6: The import still fails unless you add the symbolic link (Step 3 above; repeated here):
vasilios@exumas: /usr/local/anaconda/envs/py35/lib
└─ $ ln -s /Library/Frameworks/Mono.framework/Versions/Current/lib/mono
  • 2.7: The import fails with the following error message (after adding the symbolic link)
In [1]: import clr
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-a49e61dd6f13> in <module>()
----> 1 import clr

ImportError: System.DllNotFoundException: libpython2.7.so
  at (wrapper managed-to-native) Python.Runtime.Runtime:Py_IsInitialized ()
  at Python.Runtime.Runtime.Initialize () [0x00019] in <c13c76bbc10d436e9d26172b4b9cfd09>:0 
  at Python.Runtime.PythonEngine.Initialize (System.Collections.Generic.IEnumerable`1[T] args, System.Boolean setSysArgv) [0x00014] in <c13c76bbc10d436e9d26172b4b9cfd09>:0 
  at Python.Runtime.PythonEngine.Initialize (System.Boolean setSysArgv) [0x00005] in <c13c76bbc10d436e9d26172b4b9cfd09>:0 
  at Python.Runtime.PythonEngine.InitExt () [0x00000] in <c13c76bbc10d436e9d26172b4b9cfd09>:0 

In [2]: 

NOTE: The above were run in conda environments created as described above.

@vmuriart
Copy link
Contributor
vmuriart commented Mar 1, 2017

The dllnotfoundexception is due to the dll.config being written for Linux. Thats what #120 was trying to solve. I just removed the dependency on dll.config a couple hours ago on 9650e8b. Try building that one and you shouldnt have the dllnotfoundexception anymore.

irt to having to link the library and define pkg_config_path, can you check what value of rtdir is with and without the symbolic link.

I think you have multiple mono installed on your system and it may be using the wrong one to build and perform everything else.

@vmuriart
Copy link
Contributor
vmuriart commented Mar 1, 2017

what was the output of step 1 without setting PKG_CONFIG_PATH? Above only included the output after it succeeded.

@fractus
Copy link
Contributor Author
fractus commented Mar 1, 2017

@vmuriart
Sorry, my bad for the dll error -- it works after updating master.

I have recently updated to 4.6.2, and removed the previous version; is there a chance something is not done properly? I'll try with the latest mono version (4.8).

(delme35) vasilios@exumas:~/Temp/pythonnet [master | ✔]
└─ $ locate mono.pc
/Library/Frameworks/Mono.framework/Versions/4.6.2/lib/pkgconfig/mono.pc

(delme35) vasilios@exumas:~/Temp/pythonnet [master | ✔]
└─ $ ll /Library/Frameworks/Mono.framework/Versions/
total 8
drwxr-xr-x  11 root  admin   374B 17 Feb 22:20 4.6.2
lrwxr-xr-x   1 root  admin    49B 17 Feb 22:20 Current -> /Library/Frameworks/Mono.framework/Versions/4.6.2

(delme35) vasilios@exumas: ~/Temp
└─ $ cat /etc/paths.d/mono-commands 
/Library/Frameworks/Mono.framework/Versions/Current/Commands
  • Output of rtdir:
(delme35) vasilios@exumas:~/Temp/delme-pythonnet [master | ✔]
└─ $ csharp 
Mono C# Shell, type "help;" for help

Enter statements below.
csharp> using System.Runtime.InteropServices;    
csharp> RuntimeEnvironment.GetRuntimeDirectory() 
"/Library/Frameworks/Mono.framework/Versions/4.6.2/lib/mono/4.5"
  • Output of build before setting PKG_CONFIG_PATH:
(delme35) vasilios@exumas:~/Temp/delme-pythonnet [master | ✔]
└─ $ python setup.py build
running build
running build_ext
Checking for updates from https://www.nuget.org/api/v2/.
Currently running NuGet.exe 3.5.0.
NuGet.exe is up to date.
MSBuild auto-detection: using msbuild version '14.1' from '/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/msbuild/14.1/bin/'.
Restoring NuGet package NUnit.3.6.0.
Restoring NuGet package UnmanagedExports.1.2.7.
Restoring NuGet package NUnit.ConsoleRunner.3.6.0.
Adding package 'NUnit.ConsoleRunner.3.6.0' to folder '/Users/vasilios/Temp/delme-pythonnet/packages'
Adding package 'UnmanagedExports.1.2.7' to folder '/Users/vasilios/Temp/delme-pythonnet/packages'
Adding package 'NUnit.3.6.0' to folder '/Users/vasilios/Temp/delme-pythonnet/packages'
Added package 'UnmanagedExports.1.2.7' to folder '/Users/vasilios/Temp/delme-pythonnet/packages'
Added package 'NUnit.ConsoleRunner.3.6.0' to folder '/Users/vasilios/Temp/delme-pythonnet/packages'
Added package 'NUnit.3.6.0' to folder '/Users/vasilios/Temp/delme-pythonnet/packages'

NuGet Config files used:
    /Users/vasilios/.config/NuGet/NuGet.Config

Feeds used:
    /Users/vasilios/.nuget/packages/
    https://api.nuget.org/v3/index.json

Installed:
    3 package(s) to packages.config projects
clang: warning: /usr/local/anaconda/envs/delme35/include/python3.5m: 'linker' input unused
XBuild Engine Version 14.0
Mono, Version 4.6.2.0
Copyright (C) 2005-2013 Various Mono authors
XBuild Engine Version 14.0
Mono, Version 4.6.2.0
Copyright (C) 2005-2013 Various Mono authors
		Configuration: ReleaseMono Platform: x64
classderived.cs(149,26): warning CS0219: The variable `fb' is assigned but its value is never used
classderived.cs(890,18): warning CS0219: The variable `t' is assigned but its value is never used
methodbinder.cs(141,36): warning CS0219: The variable `typeArgs' is assigned but its value is never used
methodbinding.cs(109,25): warning CS0219: The variable `len' is assigned but its value is never used
methodbinding.cs(151,24): warning CS0219: The variable `superType' is assigned but its value is never used
moduleobject.cs(195,33): warning CS0219: The variable `attr' is assigned but its value is never used
pythonengine.cs(575,33): warning CS0219: The variable `args' is assigned but its value is never used
runtime.cs(1467,20): warning CS0472: The result of comparing value type `System.IntPtr' with null is always `true'
runtime.cs(166,76): warning CS0429: Unreachable expression code detected
converter.cs(25,29): warning CS0414: The private field `Python.Runtime.Converter.decimalType' is assigned but its value is never used
Configuration: ReleaseMono Platform: x64
fieldtest.cs(17,17): warning CS0219: The variable `i' is assigned but its value is never used
fieldtest.cs(18,17): warning CS0219: The variable `j' is assigned but its value is never used
arraytest.cs(41,23): warning CS0414: The private field `Python.
8000
Test.PrivateArrayTest.items' is assigned but its value is never used
Configuration: ReleaseMono Platform: x64
dynamic.cs(121,22): warning CS0219: The variable `res' is assigned but its value is never used
Configuration: ReleaseMono Platform: x64
pythonconsole.cs(29,28): warning CS0219: The variable `a' is assigned but its value is never used
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 407, in <module>
    zip_safe=False,
  File "/usr/local/anaconda/envs/delme35/lib/python3.5/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/local/anaconda/envs/delme35/lib/python3.5/distutils/dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "/usr/local/anaconda/envs/delme35/lib/python3.5/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/usr/local/anaconda/envs/delme35/lib/python3.5/distutils/command/build.py", line 135, in run
    self.run_command(cmd_name)
  File "/usr/local/anaconda/envs/delme35/lib/python3.5/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/usr/local/anaconda/envs/delme35/lib/python3.5/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/usr/local/anaconda/envs/delme35/lib/python3.5/distutils/command/build_ext.py", line 338, in run
    self.build_extensions()
  File "/usr/local/anaconda/envs/delme35/lib/python3.5/distutils/command/build_ext.py", line 447, in build_extensions
    self._build_extensions_serial()
  File "/usr/local/anaconda/envs/delme35/lib/python3.5/distutils/command/build_ext.py", line 472, in _build_extensions_serial
    self.build_extension(ext)
  File "setup.py", line 227, in build_extension
    self._build_monoclr()
  File "setup.py", line 241, in _build_monoclr
    mono_libs = _check_output("pkg-config --libs mono-2", shell=True)
  File "setup.py", line 88, in _check_output
    output = subprocess.check_output(*args, **kwargs)
  File "/usr/local/anaconda/envs/delme35/lib/python3.5/subprocess.py", line 626, in check_output
    **kwargs).stdout
  File "/usr/local/anaconda/envs/delme35/lib/python3.5/subprocess.py", line 708, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command 'pkg-config --libs mono-2' returned non-zero exit status 1

NOTE: All in new temp conda environments and new clone of this project. This is a log of all commands, if it provides any further clues, log35.txt

@fractus
Copy link
Contributor Author
fractus commented Mar 1, 2017

@vmuriart
You can avoid setting the PKG_EXPORT_PATH if you use the pkg-config that is part of the mono installation;

(test35) vasilios@exumas: ~/Temp
└─ $ ll /Library/Frameworks/Mono.framework/Versions/4.8.0/bin/ | grep pkg-config
lrwxr-xr-x  1 root  admin    12B  1 Mar 21:49 pkg-config -> pkg-config32
lrwxr-xr-x  1 root  admin    20B  1 Mar 21:49 pkg-config.release -> pkg-config32.release
-rwxr-xr-x  1 root  admin   668K  1 Mar 21:49 pkg-config32
-rwxr-xr-x  1 root  admin   705K  1 Mar 21:49 pkg-config64

Just need a symbolic link to /usr/local/bin, since mono doesn't put it in path.

Same issue with 4.8.0. I also explicitly updated the dyld cache using update_dyld_shared_cache. I'll see if there's any "dangling" refs to some older installation.

Note that installing a new version using the pkg from http://www.mono-project.com/download/ removes the previous one....

@fractus
Copy link
Contributor Author
fractus commented Mar 1, 2017

The .so file seems to points to the correct path:

(delme35) vasilios@exumas: /usr/local/anaconda/envs/delme35/lib/python3.5/site-packages/pythonnet-2.3.0.dev1-py3.5-macosx-10.6-x86_64.egg
└─ $ otool -L clr.cpython-35m-darwin.so 
clr.cpython-35m-darwin.so:
	/Library/Frameworks/Mono.framework/Versions/4.6.2/lib/libmonosgen-2.0.1.dylib (compatibility version 2.0.0, current version 2.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.0.0)
	/Library/Frameworks/Mono.framework/Versions/4.6.2/lib/libglib-2.0.0.dylib (compatibility version 3601.0.0, current version 3601.4.0)
	/Library/Frameworks/Mono.framework/Versions/4.6.2/lib/libintl.8.dylib (compatibility version 10.0.0, current version 10.2.0)```

@vmuriart
Copy link
Contributor
vmuriart commented Mar 1, 2017

Sorry, my bad for the dll error -- it works after updating master.

Thanks for testing this for us! I had a strong inkling the change fixed it, but wasn't 100% sure.

From the logs, its finding the right mono during setup and even seems to have the right rtdir. I'm a bit stumped on this one at the moment.

@fractus
Copy link
Contributor Author
fractus commented Mar 1, 2017

A step further (no manual symbolic links; moved to 4.8.0):

  • Set library path:
(py36) vasilios@exumas: ~/Temp
└─ $ export DYLD_LIBRARY_PATH=/Library/Frameworks/Mono.framework/Versions/Current/lib
  • Still fails but different error message:
(py36) vasilios@exumas: ~/Temp
└─ $ python -c "import clr"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: dlopen(/usr/local/anaconda/envs/py36/lib/python3.6/site-packages/pythonnet-2.3.0.dev1-py3.6-macosx-10.7-x86_64.egg/clr.cpython-36m-darwin.so, 2): Symbol not found: __cg_jpeg_resync_to_restart
  Referenced from: /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
  Expected in: /Library/Frameworks/Mono.framework/Versions/Current/lib/libJPEG.dylib
 in /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
  • Versions of libJPEG.dylib in System and mono are different:
root@exumas: /Library/Frameworks/Mono.framework/Versions/Current/lib
└─ # otool -L libJPEG.dylib 
libJPEG.dylib:
	/Library/Frameworks/Mono.framework/Versions/4.8.0/lib/libjpeg.8.dylib (compatibility version 9.0.0, current version 9.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)

root@exumas: /Library/Frameworks/Mono.framework/Versions/Current/lib
└─ # otool -L /System/Library/Frameworks/ImageIO.framework/Resources/libJPEG.dylib 
/System/Library/Frameworks/ImageIO.framework/Resources/libJPEG.dylib:
	/System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libJPEG.dylib (compatibility version 1.0.0, current version 1.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
  • Update library path to point first to system:
(py36) vasilios@exumas: ~/Temp
└─ $ export DYLD_LIBRARY_PATH=/System/Library/Frameworks/ImageIO.framework/Resources:/Library/Frameworks/Mono.framework/Versions/Current/lib
  • Failing still but another error message now:
(py36) vasilios@exumas: ~/Temp
└─ $ python -c "import clr"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: dlopen(/usr/local/anaconda/envs/py36/lib/python3.6/site-packages/pythonnet-2.3.0.dev1-py3.6-macosx-10.7-x86_64.egg/clr.cpython-36m-darwin.so, 2): Symbol not found: _sqlite3_intarray_bind
  Referenced from: /System/Library/Frameworks/CoreData.framework/Versions/A/CoreData
  Expected in: /Library/Frameworks/Mono.framework/Versions/Current/lib/libsqlite3.dylib
 in /System/Library/Frameworks/CoreData.framework/Versions/A/CoreData

I feel I'm deviating on a tangent here, so I'll just stop at this point, because with the symbolic link all works fine.

@vmuriart
Copy link
Contributor
vmuriart commented Mar 2, 2017

yea. I'll leave the issue open for now in case someone else has a similar issue. I'm not sure if its an issue isolated to the setup you are using, or something else altogether.

Glad to hear all else works fine though after the symlink. And thanks for the detailed troubleshooting and information

@den-run-ai
Copy link
Contributor

@vmuriart @fractus I'm closing this issue, let's keep open this issue below for all Mac OSX settings and gotchas until the CI support is merged:

#465

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

No branches or pull requests

3 participants
0